Method: TensorStream::Evaluator::BaseEvaluator.register_op

Defined in:
lib/tensor_stream/evaluator/base_evaluator.rb

.register_op(opcode, options = {}, &block) ⇒ Object

registers an op for the current evaluator class



100
101
102
103
104
105
106
107
108
109
# File 'lib/tensor_stream/evaluator/base_evaluator.rb', line 100

def self.register_op(opcode, options = {}, &block)
  @ops ||= {}
  if opcode.is_a?(Array)
    opcode.each do |op|
      @ops[op.to_sym] = {options: options, block: block}
    end
  else
    @ops[opcode.to_sym] = {options: options, block: block}
  end
end