18 const std::vector<symbolic::Expression>&
shape,
19 const std::vector<int64_t>&
axes,
45 std::unique_ptr<data_flow::DataFlowNode>
size_t element_id() const
const DebugInfo & debug_info() const
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
Definition data_flow_graph.h:29
graph::Vertex vertex() const
Get the graph vertex for this node.
Definition reduce_node.h:230
ReduceNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const data_flow::LibraryNodeCode &code, const std::vector< symbolic::Expression > &shape, const std::vector< int64_t > &axes, bool keepdims)
Construct a reduction node.
const std::vector< symbolic::Expression > & shape() const
Get the input tensor shape.
Definition reduce_node.h:123
const std::vector< int64_t > & axes() const
Get the reduction axes.
Definition reduce_node.h:131
bool keepdims() const
Check if reduced dimensions are kept.
Definition reduce_node.h:139
bool expand_reduction(passes::LibNodeExpander::AccessNodeExpand &expansion, builder::StructuredSDFGBuilder &builder, structured_control_flow::Sequence &body, const types::Tensor &input_type, const types::Tensor &output_type, const data_flow::Subset &input_subset, const data_flow::Subset &output_subset) override
Generate the actual reduction code.
void validate(const Function &function) const override
Validate the code node's configuration.
SoftmaxNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const std::vector< symbolic::Expression > &shape, const std::vector< int64_t > &axes, bool keepdims=false)
std::unique_ptr< data_flow::DataFlowNode > clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph &parent) const override
Clone this node for graph transformations.
bool supports_integer_types() const override
Check if this operation supports integer types.
Definition softmax_node.h:41
std::string identity(types::PrimitiveType primitive_type) const override
Get the identity value for this reduction.
Definition softmax_node.h:37
passes::LibNodeExpander::ExpandOutcome expand(passes::LibNodeExpander::ExpandContext &context, Block &block) override
Expand into nested maps with reduction logic.
types::PrimitiveType primitive_type(const data_flow::DataFlowGraph &graph) const
Get the primitive type of this tensor operation.
Definition lib_node_expander.h:45
Definition lib_node_expander.h:122
A control flow node representing a basic block with dataflow computations.
Definition block.h:42
A sequential container of control flow nodes.
Definition sequence.h:52
Definition function_builder.h:10
symbolic::MultiExpression Subset
Type alias for a subset specification (array of symbolic expressions).
Definition memlet.h:103
StringEnum LibraryNodeCode
Definition library_node.h:65
boost::graph_traits< Graph >::vertex_descriptor Vertex
Definition graph.h:25
Definition arange_node.h:8
data_flow::LibraryNodeCode LibraryNodeType_Softmax("ml::Softmax")
ReduceNodeSerializer< SoftmaxNode > SoftmaxNodeSerializer
Definition softmax_node.h:49
Definition batched_gemm_node.h:12
PrimitiveType
Enumeration of all primitive data types supported by sdfglib.
Definition type.h:35
Tensor reduction operation nodes.
Definition lib_node_expander.h:12