Struct anira::v2::TensorShape#

struct TensorShape#

The tensor shapes of a 2.x configuration: universal (every backend) or of one backend, whose row must hold the universal shapes with their axes permuted or unit axes inserted (anira 3 keeps one shape per tensor and an axis layout per engine; a row that reshapes is refused with ANIRA_ERROR_JSON when the configuration is built).

Public Functions

TensorShape() = delete#
inline TensorShape(TensorShapeList input_shape, TensorShapeList output_shape)#

A universal row.

Throws:

Error{ANIRA_ERROR_INVALID_ARGUMENT} – for an empty list.

inline TensorShape(TensorShapeList input_shape, TensorShapeList output_shape, InferenceBackend backend)#

A row of one backend.

Throws:

Error{ANIRA_ERROR_INVALID_ARGUMENT} – for an empty list.

inline bool is_universal() const noexcept#
inline bool operator==(const TensorShape &other) const noexcept#

The 2.x rule: two universal rows by their shapes, two backend rows by their shapes and backend, never one of each.

inline bool operator!=(const TensorShape &other) const noexcept#

Public Members

TensorShapeList m_tensor_input_shape#
TensorShapeList m_tensor_output_shape#
InferenceBackend m_backend = CUSTOM#

a backend row’s backend; CUSTOM on a universal row

bool m_universal = false#