Class PythonEinsumGeneratorContext¶
Defined in File python_einsum.hpp
Inheritance Relationships¶
Base Type¶
public sequant::ExportContext(Class ExportContext)
Derived Types¶
public sequant::NumPyEinsumGeneratorContext(Class NumPyEinsumGeneratorContext)public sequant::PyTorchEinsumGeneratorContext(Class PyTorchEinsumGeneratorContext)
Class Documentation¶
-
class PythonEinsumGeneratorContext : public sequant::ExportContext¶
Base context class for Python einsum generators.
Subclassed by sequant::NumPyEinsumGeneratorContext, sequant::PyTorchEinsumGeneratorContext
Public Types
-
using ShapeMap = std::map<IndexSpace, std::string>¶
-
using TagMap = std::map<IndexSpace, std::string>¶
Public Functions
-
PythonEinsumGeneratorContext() = default¶
-
~PythonEinsumGeneratorContext() = default¶
-
inline bool generate_imports() const¶
Get whether to generate import statements.
-
inline void set_generate_imports(bool value)¶
Set whether to generate import statements.
-
inline MemoryLayout memory_layout() const¶
Get the memory layout for tensors.
-
inline void set_memory_layout(MemoryLayout layout)¶
Set the memory layout for tensors.
-
inline std::string get_shape(const IndexSpace &space) const¶
Get the dimension/shape for a given index space.
-
inline void set_shape(const IndexSpace &space, std::string shape)¶
Set the dimension/shape for a given index space.
-
inline std::string get_tag(const IndexSpace &space) const¶
Get the tag for a given index space Tags are appended to tensor names to distinguish different blocks
-
inline void set_tag(const IndexSpace &space, std::string tag)¶
Set the tag for a given index space.
Protected Attributes
-
bool m_generate_imports = true¶
-
MemoryLayout m_memory_layout = MemoryLayout::ColumnMajor¶
-
using ShapeMap = std::map<IndexSpace, std::string>¶