TensorSpec

class dragon.vm.tensorflow.TensorSpec(
  shape,
  dtype='float32',
  name=None
)[source]

Spec to describe properties of a tensor.

__init__

TensorSpec.__init__(
  shape,
  dtype='float32',
  name=None
)[source]

Create a TensorSpec.

Parameters:
  • shape (Sequence[int], required) The dimensions.
  • dtype (str, optional, default='float32') The optional data type.
  • name (str, optional) The optional name.

Properties

dtype

TensorSpec.dtype

Return the data type.

Returns:
str The data type.

name

TensorSpec.name

Return the spec name.

Returns:
str The spec name.

shape

TensorSpec.shape

Return the dimensions.

Returns:
Sequence[int] The dimensions.