Class: Kumi::IR::DF::Ops::Reduce
- Inherits:
-
Node
- Object
- Base::Instruction
- Node
- Kumi::IR::DF::Ops::Reduce
- Defined in:
- lib/kumi/ir/df/ops/reduce.rb
Instance Attribute Summary
Attributes inherited from Base::Instruction
#attributes, #axes, #dtype, #effects, #inputs, #metadata, #opcode, #result
Instance Method Summary collapse
-
#initialize(fn:, arg:, over_axes:, **kwargs) ⇒ Reduce
constructor
A new instance of Reduce.
- #over_axes ⇒ Object
- #reducer ⇒ Object
Methods inherited from Node
Methods inherited from Base::Instruction
#control_effect?, #defs, #effectful?, #io_effect?, #memory_effect?, #normalized_attributes, #printer_attributes, #printer_axes, #printer_dtype, #produces?, #stamp, #state_effect?, #to_h, #to_print_string, #uses, #validate!, #value_signature, #with_metadata
Constructor Details
#initialize(fn:, arg:, over_axes:, **kwargs) ⇒ Reduce
Returns a new instance of Reduce.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/kumi/ir/df/ops/reduce.rb', line 10 def initialize(fn:, arg:, over_axes:, **kwargs) super( inputs: [arg], attributes: { fn: fn.to_sym, over_axes: Array(over_axes).map(&:to_sym) }, **kwargs ) end |
Instance Method Details
#over_axes ⇒ Object
22 |
# File 'lib/kumi/ir/df/ops/reduce.rb', line 22 def over_axes = attributes[:over_axes] |
#reducer ⇒ Object
21 |
# File 'lib/kumi/ir/df/ops/reduce.rb', line 21 def reducer = attributes[:fn] |