TensorDesc Constructor

Applicable Products

All processors

Function Usage

Creates a TensorDesc object.

Prototype

1
TensorDesc(shape: Optional[List[int]] = None, format: Format = Format.FORMAT_ND, data_type: DataType = DataType.DT_FLOAT)

Parameters

Parameter

Input/Output

Description

shape

Input

Tensor shape, which is of the list[int] type. A shape object can be passed. None indicates a scalar.

format

Input

Tensor data format, which is of the Format type. The default value is Format.FORMAT_ND.

data_type

Input

Tensor data type, which is of the DataType type. The default value is DataType.DT_FLOAT.

Returns

TensorDesc object

Restrictions

  • If format is not of the Format type, TypeError is thrown.
  • If data_type is not of the DataType type, TypeError is thrown.