dataflow.TensorDesc

Applicability

Product

Supported

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

Function Description

Describes a tensor.

Prototype

1
TensorDesc(dtype: DType, shape: Union[List[int], Tuple[int]])

Parameters

Parameter

Data Type

Description

dtype

DType

Description of the data type of Tensor.

shape

Union[List[int], Tuple[int]]

Description of the shape of a tensor. Each element in the shape must be a value greater than or equal to 0.

Returns

None is returned in normal scenarios.

A DfException is thrown upon exceptions. You can catch DfException and retrieve its error_code and message attributes to check the specific error code and error details. For details, see DataFlow Error Codes.

Examples

1
tensor_desc = TensorDesc(DT_FLOAT, [1,2])

Constraints

None