39 std::vector<symbolic::Expression>
shape_;
42 std::vector<symbolic::Expression>
pads_;
52 const std::vector<std::string>&
outputs,
53 const std::vector<std::string>&
inputs,
56 const std::vector<symbolic::Expression>&
shape,
58 const std::vector<symbolic::Expression>&
strides,
59 const std::vector<symbolic::Expression>&
pads,
60 const std::vector<symbolic::Expression>&
dilations
63 const std::vector<symbolic::Expression>&
shape()
const {
69 const std::vector<symbolic::Expression>&
strides()
const {
72 const std::vector<symbolic::Expression>&
pads()
const {
75 const std::vector<symbolic::Expression>&
dilations()
const {
143 std::basic_ostream<char>&
operator<<(std::basic_ostream<char>& os)
const;
149 std::vector<symbolic::Expression>
shape;
152 std::vector<symbolic::Expression>
pads;
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 DataFlowGraph & get_parent() const
Get the parent dataflow graph (const).
const LibraryNodeCode & code() const
Get the operation code.
Definition spatial_tensor_node.h:146
void fill_base_values(const SpatialTensorNode &node, nlohmann::json &j)
BaseDeser deserialize_base_values(const nlohmann::json &j)
Specialization of TensorNode for spatial operations such as Convolution and Pooling.
Definition spatial_tensor_node.h:36
std::basic_ostream< char > & operator<<(std::basic_ostream< char > &os) const
std::vector< symbolic::Expression > pads_
Padding (start and end for each axis).
Definition spatial_tensor_node.h:42
symbolic::Expression output_spatial_volume() const
Total number of output spatial elements: prod(output_spatial_dim(i)).
symbolic::Expression output_spatial_dim(size_t i) const
Compute the output size for spatial dimension i.
QuantizationType quantization(const data_flow::DataFlowGraph &dataflow) const
type of the math calculations.
QuantizationType fixed_quantization() const
configuration of the type for the math calculations, independent of current input types etc.
const std::vector< symbolic::Expression > & shape() const
Definition spatial_tensor_node.h:63
const std::vector< symbolic::Expression > & strides() const
Definition spatial_tensor_node.h:69
const std::vector< symbolic::Expression > & dilations() const
Definition spatial_tensor_node.h:75
std::optional< QuantizationType > uniform_quantization(const data_flow::DataFlowGraph &dataflow) const
Same result as quantization if it matches all the inputs.
QuantizationType fixed_quantization_
Definition spatial_tensor_node.h:38
std::vector< symbolic::Expression > dilations_
Dilation along each spatial axis.
Definition spatial_tensor_node.h:43
std::vector< symbolic::Expression > shape_
Input shape [N, C, D1, ..., Dn].
Definition spatial_tensor_node.h:39
symbolic::Expression kernel_volume() const
Total number of kernel / window elements: prod(kernel_shape[i]).
symbolic::SymbolSet symbols() const override
Get all symbols used in this node.
void set_fixed_quantization(const QuantizationType quant)
SpatialTensorNode(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, QuantizationType quantization, const std::vector< symbolic::Expression > &shape, const std::vector< symbolic::Expression > &kernel_shape, const std::vector< symbolic::Expression > &strides, const std::vector< symbolic::Expression > &pads, const std::vector< symbolic::Expression > &dilations)
QuantizationType quantization() const
Definition spatial_tensor_node.h:79
const std::vector< symbolic::Expression > & pads() const
Definition spatial_tensor_node.h:72
const std::vector< symbolic::Expression > & kernel_shape() const
Definition spatial_tensor_node.h:66
void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
std::vector< symbolic::Expression > strides_
Stride along each spatial axis.
Definition spatial_tensor_node.h:41
size_t num_spatial_dims() const
Number of spatial dimensions.
std::vector< symbolic::Expression > kernel_shape_
Pooling window shape [k1, ..., kn].
Definition spatial_tensor_node.h:40
void replace(const symbolic::ExpressionMapping &replacements) override
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.
Base class for library node serialization.
Definition json_serializer.h:195
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
std::set< Symbol, SymEngine::RCPBasicKeyLess > SymbolSet
Ordered set of symbols.
Definition symbolic.h:95
SymEngine::map_basic_basic ExpressionMapping
Definition symbolic.h:109
StringEnum ImplementationType
Implementation type identifier for library nodes.
Definition library_node.h:75
StringEnum LibraryNodeCode
Definition library_node.h:65
boost::graph_traits< Graph >::vertex_descriptor Vertex
Definition graph.h:25
Definition arange_node.h:8
types::PrimitiveType QuantizationType
Definition tensor_node.h:26
Definition batched_gemm_node.h:12
Definition spatial_tensor_node.h:148
std::vector< symbolic::Expression > strides
Definition spatial_tensor_node.h:151
std::vector< symbolic::Expression > pads
Definition spatial_tensor_node.h:152
DebugInfo debug_info
Definition spatial_tensor_node.h:155
std::vector< symbolic::Expression > dilations
Definition spatial_tensor_node.h:153
std::vector< symbolic::Expression > shape
Definition spatial_tensor_node.h:149
QuantizationType quantization
Definition spatial_tensor_node.h:154
std::vector< symbolic::Expression > kernel_shape
Definition spatial_tensor_node.h:150
Symbolic system for integer-based symbol analysis.
Abstract base class for tensor library nodes.