dataflow.TensorDesc

Applicable Products

Product

Supported

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Function Description

Describes a tensor.

Prototype

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

Parameters

Parameter

Data Type

Value 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.

The DfException exception is reported in abnormal scenarios. You can obtain error_code and message in DfException to view the error code and error information. For details, see DataFlow Error Codes.

Examples

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

Constraints

None