dataflow.TensorDesc
Applicable Products
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
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
Parent topic: Graph Construction APIs