15 std::unique_ptr<Scalar> element_type_;
29 [[deprecated(
"Use TensorLayout")]]
Tensor(
47 [[deprecated(
"Use TensorLayout")]]
Tensor(
104 virtual std::unique_ptr<IType>
clone()
const override;
106 virtual std::string
print()
const override;
110 std::unique_ptr<Tensor>
newaxis(
size_t axis)
const;
112 std::unique_ptr<Tensor>
flip(
size_t axis)
const;
116 std::unique_ptr<Tensor>
squeeze(
size_t axis)
const;
The metadata associated with a addressing a tensor in elements Meant to be used with TensorNodes to d...
Definition tensor_layout.h:20
IType(StorageType storage_type=StorageType::CPU_Stack(), size_t alignment=0, const std::string &initializer="")
Constructs an IType with optional storage, alignment, and initializer.
Definition type.h:638
StorageType storage_type() const
Gets the storage type (const version).
Definition type.h:651
std::string initializer() const
Gets the initializer expression.
Definition type.h:683
size_t alignment() const
Gets the alignment requirement in bytes.
Definition type.h:673
Represents a scalar primitive type.
Definition scalar.h:27
Represents the storage location and management characteristics of data.
Definition type.h:64
std::unique_ptr< Tensor > flip(size_t axis) const
const symbolic::MultiExpression & shape() const
std::unique_ptr< Tensor > reshape(const symbolic::MultiExpression &new_shape) const
virtual TypeID type_id() const override
Returns the TypeID for runtime type identification.
std::unique_ptr< Tensor > squeeze(size_t axis) const
symbolic::Expression total_size() const
std::unique_ptr< Tensor > broadcast(const symbolic::MultiExpression &ref_shape) const
Broadcast this tensor to a bigger shape with strides correctly set.
Tensor(const Scalar &element_type, const symbolic::MultiExpression &shape)
virtual bool operator==(const IType &other) const override
Compares two types for equality.
std::unique_ptr< Tensor > squeeze() const
Tensor(StorageType storage_type, size_t alignment, const std::string &initializer, const Scalar &element_type, const math::tensor::TensorLayout &layout)
virtual bool is_symbol() const override
Checks if this type represents a symbolic/integer type.
Tensor(StorageType storage_type, size_t alignment, const std::string &initializer, const Scalar &element_type, const symbolic::MultiExpression &shape, const symbolic::MultiExpression &strides, const symbolic::Expression &offset=symbolic::zero())
const Scalar & element_type() const
Tensor(const Scalar &element_type, const math::tensor::TensorLayout &layout)
std::unique_ptr< Tensor > unsqueeze(size_t axis) const
Tensor(const Scalar &element_type, const symbolic::MultiExpression &shape, const symbolic::MultiExpression &strides, const symbolic::Expression &offset=symbolic::zero())
virtual void replace_symbols(const symbolic::ExpressionMapping &replacements) override
std::unique_ptr< Tensor > newaxis(size_t axis) const
bool is_pointer_like() const override
Checks if this is a pointer or a structure behaves like a pointer.
Definition tensor.h:63
virtual PrimitiveType primitive_type() const override
Returns the primitive type for this type.
const symbolic::Expression & offset() const
virtual void replace_symbols(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
Replace symbolic expressions on this type.
const symbolic::MultiExpression & strides() const
const math::tensor::TensorLayout & layout() const
symbolic::Expression total_elements() const
bool is_contiguous() const
virtual std::string print() const override
Returns a string representation of this type.
virtual std::unique_ptr< IType > clone() const override
Creates a deep copy of this type.
static symbolic::MultiExpression strides_from_shape(const symbolic::MultiExpression &shape)
Integer zero()
Creates the integer constant 0.
std::vector< Expression > MultiExpression
Vector of symbolic expressions for multi-dimensional operations.
Definition symbolic.h:89
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
SymEngine::map_basic_basic ExpressionMapping
Definition symbolic.h:109
PrimitiveType
Enumeration of all primitive data types supported by sdfglib.
Definition type.h:35
TypeID
Enumeration of high-level type categories.
Definition type.h:607
Symbolic system for integer-based symbol analysis.
Core type system definitions for sdfglib.