dataflow.TensorDesc
Applicability
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 |
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
Parent topic: Graph Construction APIs