55 const nlohmann::json& j,
56 const std::string& field_name,
91 const std::vector<std::string>&
outputs,
92 const std::vector<std::string>&
inputs,
154 const std::vector<symbolic::Expression>& required_shape,
const TensorLayout& layout,
const std::string& name
size_t element_id() const
const DebugInfo & debug_info() const
const std::vector< std::string > & outputs() const
Get output connector names (const).
const std::vector< std::string > & inputs() const
Get input connector names (const).
Definition data_flow_graph.h:29
graph::Vertex vertex() const
Get the graph vertex for this node.
const LibraryNodeCode & code() const
Get the operation code.
Base class for mathematical library nodes with expansion support.
Definition math_node.h:68
The metadata associated with a addressing a tensor in elements Meant to be used with TensorNodes to d...
Definition tensor_layout.h:20
types::PrimitiveType primitive_type(const data_flow::DataFlowGraph &graph) const
Get the primitive type of this tensor operation.
void validate_shape_matches(const std::vector< symbolic::Expression > &required_shape, const TensorLayout &layout, const std::string &name) const
TensorNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const data_flow::LibraryNodeCode &code, const std::vector< std::string > &outputs, const std::vector< std::string > &inputs, const data_flow::ImplementationType &impl_type)
Construct a tensor node.
virtual bool supports_integer_types() const =0
Check if this operation supports integer types.
void validate(const Function &function) const override
Validate tensor node constraints.
virtual void verify_data_types(const data_flow::DataFlowGraph &graph) const
Called as part of validate.
static data_flow::TaskletCode get_integer_minmax_tasklet(types::PrimitiveType prim_type, bool is_max)
Get the appropriate tasklet code for min/max operations on integers.
Mathematical library node base class with expansion support.
StringEnum ImplementationType
Implementation type identifier for library nodes.
Definition library_node.h:75
StringEnum LibraryNodeCode
Definition library_node.h:65
TaskletCode
Operation codes for tasklet computations.
Definition tasklet.h:94
boost::graph_traits< Graph >::vertex_descriptor Vertex
Definition graph.h:25
Definition arange_node.h:8
constexpr QuantizationType QUANTIZATION_MATCH_INPUTS
Definition tensor_node.h:27
types::PrimitiveType QuantizationType
Definition tensor_node.h:26
types::PrimitiveType deserialize_quantization(const nlohmann::json &j, const std::string &field_name, types::PrimitiveType default_value=QUANTIZATION_MATCH_INPUTS)
Definition batched_gemm_node.h:12
PrimitiveType
Enumeration of all primitive data types supported by sdfglib.
Definition type.h:35
@ Void
Void type (0 bits).
Definition type.h:36
Element types of a contraction such as a matmul.
Definition tensor_node.h:36
types::PrimitiveType output
Definition tensor_node.h:39
static ContractionTypes deserialize_from_json(const nlohmann::json &j, const std::string &legacy_field)
Reads the types written by serialize_to_json(), or a legacy single quantization legacy_field.
static ContractionTypes uniform(types::PrimitiveType type)
The same type for inputs and output, accumulated in it; Void infers all of them.
Definition tensor_node.h:42
types::PrimitiveType accumulator
Definition tensor_node.h:38
bool operator==(const ContractionTypes &other) const =default
void serialize_to_json(nlohmann::json &j) const
types::PrimitiveType input
Definition tensor_node.h:37
Core type system definitions for sdfglib.