Class: Kumi::IR::Vec::Ops::Node
- Inherits:
-
Base::Instruction
- Object
- Base::Instruction
- Kumi::IR::Vec::Ops::Node
- Defined in:
- lib/kumi/ir/vec/ops/node.rb
Direct Known Subclasses
AxisBroadcast, AxisIndex, AxisShift, Constant, LoadField, LoadInput, MakeObject, Map, Reduce, Select
Class Attribute Summary collapse
-
.opcode_symbol ⇒ Object
readonly
Returns the value of attribute opcode_symbol.
Attributes inherited from Base::Instruction
#attributes, #effects, #inputs, #metadata, #opcode, #result
Class Method Summary collapse
Instance Method Summary collapse
- #axes ⇒ Object
- #dtype ⇒ Object
-
#initialize(result:, axes:, dtype:, inputs: [], attributes: {}, metadata: {}, effects: Base::Effects::NONE) ⇒ Node
constructor
A new instance of 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(result:, axes:, dtype:, inputs: [], attributes: {}, metadata: {}, effects: Base::Effects::NONE) ⇒ Node
Returns a new instance of Node.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/kumi/ir/vec/ops/node.rb', line 17 def initialize(result:, axes:, dtype:, inputs: [], attributes: {}, metadata: {}, effects: Base::Effects::NONE) raise ArgumentError, "dtype required" unless dtype axes = Array(axes || []).map(&:to_sym).freeze = .merge(dtype:, axes:) super( opcode: self.class.opcode_symbol || infer_opcode, result:, inputs:, attributes: attributes, metadata: , effects: ) end |
Class Attribute Details
.opcode_symbol ⇒ Object (readonly)
Returns the value of attribute opcode_symbol.
9 10 11 |
# File 'lib/kumi/ir/vec/ops/node.rb', line 9 def opcode_symbol @opcode_symbol end |
Class Method Details
.opcode(value = nil) ⇒ Object
11 12 13 14 |
# File 'lib/kumi/ir/vec/ops/node.rb', line 11 def opcode(value = nil) @opcode_symbol = value if value @opcode_symbol end |
Instance Method Details
#axes ⇒ Object
32 |
# File 'lib/kumi/ir/vec/ops/node.rb', line 32 def axes = [:axes] |
#dtype ⇒ Object
33 |
# File 'lib/kumi/ir/vec/ops/node.rb', line 33 def dtype = [:dtype] |