Class: Kumi::IR::Loop::Ops::ShiftRead
- Inherits:
-
Node
- Object
- Base::Instruction
- Node
- Kumi::IR::Loop::Ops::ShiftRead
- Defined in:
- lib/kumi/ir/loop/ops/core_ops.rb
Constant Summary collapse
- POLICIES =
%i[wrap clamp].freeze
Instance Attribute Summary
Attributes inherited from Base::Instruction
#attributes, #axes, #dtype, #effects, #inputs, #metadata, #opcode, #result
Instance Method Summary collapse
-
#initialize(array:, index:, length:, offset:, policy:, **kwargs) ⇒ ShiftRead
constructor
A new instance of ShiftRead.
- #offset ⇒ Object
- #policy ⇒ 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(array:, index:, length:, offset:, policy:, **kwargs) ⇒ ShiftRead
Returns a new instance of ShiftRead.
130 131 132 133 134 135 136 137 138 139 |
# File 'lib/kumi/ir/loop/ops/core_ops.rb', line 130 def initialize(array:, index:, length:, offset:, policy:, **kwargs) policy = policy.to_sym raise ArgumentError, "invalid shift policy #{policy}" unless POLICIES.include?(policy) super( inputs: [array, index, length], attributes: { offset: Integer(offset), policy: policy }, **kwargs ) end |
Instance Method Details
#offset ⇒ Object
141 |
# File 'lib/kumi/ir/loop/ops/core_ops.rb', line 141 def offset = attributes[:offset] |
#policy ⇒ Object
142 |
# File 'lib/kumi/ir/loop/ops/core_ops.rb', line 142 def policy = attributes[:policy] |