Skip to content

tenzr::ReduceWindowNode

More...

#include <node.h>

Inherits from tenzr::Node, std::enable_shared_from_this< Node >

Public Functions

Name
ReduceWindowNode(std::shared_ptr< Node > input, std::shared_ptr< Node > init_value, std::vector< int64_t > window_dimensions, std::vector< int64_t > window_strides, std::vector< int64_t > padding_low, std::vector< int64_t > padding_high, std::vector< int64_t > window_dilations, std::string Reduction)
virtual std::string OpName() const override
StableHLO-style name of this node's operation.
const std::shared_ptr< Node > & Input() const
const std::shared_ptr< Node > & InitValue() const
Initial value of the reduction.
const std::vector< int64_t > & WindowDimensions() const
Window extent per dimension.
const std::vector< int64_t > & WindowStrides() const
Window stride per dimension.
const std::vector< int64_t > & PaddingLow() const
Low edge padding per dimension.
const std::vector< int64_t > & PaddingHigh() const
High edge padding per dimension.
const std::vector< int64_t > & WindowDilations() const
Window dilation per dimension.
const std::string & Reduction() const
Name of the reduction, such as "add" or "max".

Additional inherited members

Public Functions inherited from tenzr::Node

Name
Node(NodeKind kind, Shape shape, DType dtype, ShardingSpec sharding =ShardingSpec::Replicated())
virtual ~Node() =default
NodeKind Kind() const
The node's operation kind.
const Shape & shape() const
The node's output shape.
DType Dtype() const
The node's output dtype.
const ShardingSpec & Sharding() const
The node's sharding spec.
void SetSharding(ShardingSpec spec)
Replace the sharding spec.
const StridedLayout & Layout() const
The node's strided layout.
void SetLayout(StridedLayout layout)
Replace the layout.
const std::vector< std::shared_ptr< Node > > & Inputs() const
The node's input operands.
uint64_t Id() const
The node's unique id.

Protected Functions inherited from tenzr::Node

Name
uint64_t NextId()

Protected Attributes inherited from tenzr::Node

Name
NodeKind kind_
Shape shape_
DType dtype_
ShardingSpec sharding_
StridedLayout layout_
std::vector< std::shared_ptr< Node > > inputs_
uint64_t id_

Detailed Description

class tenzr::ReduceWindowNode;

Sliding-window reduction over an operand, used to lower pooling operations.

Public Functions Documentation

function ReduceWindowNode

ReduceWindowNode(
    std::shared_ptr< Node > input,
    std::shared_ptr< Node > init_value,
    std::vector< int64_t > window_dimensions,
    std::vector< int64_t > window_strides,
    std::vector< int64_t > padding_low,
    std::vector< int64_t > padding_high,
    std::vector< int64_t > window_dilations,
    std::string Reduction
)

Parameters:

  • input Input node.
  • init_value Reduction identity.
  • window_dimensions Window extent per dimension.
  • window_strides Window stride per dimension.
  • padding_low Low padding per dimension.
  • padding_high High padding per dimension.
  • window_dilations Window dilation per dimension.
  • Reduction Reduction operator name.

Create a windowed reduction node, normalizing default window parameters.

function OpName

inline virtual std::string OpName() const override

StableHLO-style name of this node's operation.

Reimplements: tenzr::Node::OpName

function Input

inline const std::shared_ptr< Node > & Input() const

function InitValue

inline const std::shared_ptr< Node > & InitValue() const

Initial value of the reduction.

function WindowDimensions

inline const std::vector< int64_t > & WindowDimensions() const

Window extent per dimension.

function WindowStrides

inline const std::vector< int64_t > & WindowStrides() const

Window stride per dimension.

function PaddingLow

inline const std::vector< int64_t > & PaddingLow() const

Low edge padding per dimension.

function PaddingHigh

inline const std::vector< int64_t > & PaddingHigh() const

High edge padding per dimension.

function WindowDilations

inline const std::vector< int64_t > & WindowDilations() const

Window dilation per dimension.

function Reduction

inline const std::string & Reduction() const

Name of the reduction, such as "add" or "max".