ExamGecko
Question list
Search
Search

List of questions

Search

Question 2 - H13-311_V3.5 discussion

Report
Export

When you use MindSpore to execute the following code, which of the following is the output?

python

Copy code

x = Tensor(np.array([[1, 2], [3, 4]]), dtype.int32)

x.dtype

A.
2
Answers
A.
2
B.
mindspore.int32
Answers
B.
mindspore.int32
C.
4
Answers
C.
4
D.
(2,2)
Answers
D.
(2,2)
Suggested answer: B

Explanation:

In MindSpore, when you define a tensor using Tensor(np.array([[1, 2], [3, 4]]), dtype.int32), the dtype attribute returns the data type of the tensor, which in this case is mindspore.int32. This specifies the type of elements in the tensor.

asked 26/09/2024
Wilfried Wagener
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first