get_data

Function Usage

Obtains tensor data.

Prototype

1
get_data() -> TensorLike

Parameters

None

Returns

TensorLike type tensor data.

Constraints

If the value fails to be obtained, RuntimeError is thrown.

TensorLike type

TensorLike is a type alias, indicating a tensor-like object.

  • A single number (int or float)
  • Numeric list (nested list)

The definition is as follows:

1
TensorLike = Union[int, float, List['TensorLike']]