Sha256: 793eeaee255a5e980febb2e4798711269ec8a3c325ff6950735fc83ddb151afc

Contents?: true

Size: 621 Bytes

Versions: 4

Compression:

Stored size: 621 Bytes

Contents

module TensorStream
  # Defines a TensorStream controlflow op
  class ControlFlow < Operation
    attr_accessor :ops

    def initialize(flow_type, inputs, ops = nil, options = {})
      setup_initial_state(options)
      @options = options
      @operation = :"flow_#{flow_type}"
      @inputs = inputs
      @name = [@graph.get_name_scope, options[:name] || set_name].compact.join('/')
      @ops = ops
      @consumers = Set.new
      @shape = TensorShape.new([inputs.size])
      @graph.add_node(self)
    end

    def set_data_type(_passed_data_type)
      :unknown
    end

    def run
      eval
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tensor_stream-1.0.0 lib/tensor_stream/control_flow.rb
tensor_stream-1.0.0.pre.rc1 lib/tensor_stream/control_flow.rb
tensor_stream-0.9.10 lib/tensor_stream/control_flow.rb
tensor_stream-0.9.9 lib/tensor_stream/control_flow.rb