|
NEML2 2.0.0
|
Traceable tensor shape. More...
Traceable tensor shape.
A tensor shape can be either a concrete shape or a traceable tensor. This is useful when we need to trace a function graph and let it generalize to other batch shapes.
#include <TraceableTensorShape.h>

Public Types | |
| using | Size = int64_t |
Public Member Functions | |
| TraceableTensorShape (const TensorShape &shape) | |
| TraceableTensorShape (TensorShapeRef shape) | |
| TraceableTensorShape (Size shape) | |
| TraceableTensorShape (const ATensor &shape) | |
| TraceableTensorShape | slice (std::size_t N, std::size_t M) const |
| Slice the shape. | |
| TraceableTensorShape | slice (std::size_t N) const |
| Chop-off the first N elements of the shape, semantically the same as ArrayRef::slice, but traceable. | |
| TensorShape | concrete () const |
| ATensor | as_tensor () const |
| using Size = int64_t |
| TraceableTensorShape | ( | const TensorShape & | shape | ) |
| TraceableTensorShape | ( | TensorShapeRef | shape | ) |
| TraceableTensorShape | ( | Size | shape | ) |
| TraceableTensorShape | ( | const ATensor & | shape | ) |
| ATensor as_tensor | ( | ) | const |
| TensorShape concrete | ( | ) | const |
| TraceableTensorShape slice | ( | std::size_t | N | ) | const |
Chop-off the first N elements of the shape, semantically the same as ArrayRef::slice, but traceable.
| TraceableTensorShape slice | ( | std::size_t | N, |
| std::size_t | M ) const |
Slice the shape.