18 const std::vector<symbolic::Expression>&
shape,
19 const std::vector<int64_t>&
axes,
39 std::unique_ptr<data_flow::DataFlowNode>
48 const std::vector<symbolic::Expression>& output_shape,
49 const std::vector<int64_t>& sorted_axes
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.
Edge in the dataflow graph representing data movement.
Definition memlet.h:131
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.
passes::LibNodeExpander::ExpandOutcome expand_inner(passes::LibNodeExpander::AccessNodeExpand &expansion, structured_control_flow::Block &block, const data_flow::Memlet *iedge_input, const data_flow::Memlet *iedge_result, const std::vector< symbolic::Expression > &output_shape, const std::vector< int64_t > &sorted_axes) override
bool supports_integer_types() const override
Check if this operation supports integer types.
Definition std_node.h:35
std::string identity(types::PrimitiveType primitive_type) const override
Get the identity value for this reduction.
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.
StdNode(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)
types::PrimitiveType primitive_type(const data_flow::DataFlowGraph &graph) const
Get the primitive type of this tensor operation.
Definition lib_node_expander.h:45
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
ReduceNodeSerializer< StdNode > StdNodeSerializer
Definition std_node.h:53
data_flow::LibraryNodeCode LibraryNodeType_Std("ml::Std")
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