Sha256: 2e947e041ac91c88306b272cb88c077135a397aedb9da271c3d96c0a8ebdee28

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

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

    def initialize(flow_type, items, ops = nil, options = {})
      @graph = options[:graph] || TensorStream.get_default_graph

      @operation = :"flow_#{flow_type}"
      @items = items
      @name = [@graph.get_name_scope, options[:name] || set_name].compact.join('/')
      @ops = ops
      @source = format_source(caller_locations)
      @shape = TensorShape.new([items.size])
      @graph.add_node(self)
    end

    def set_data_type(_passed_data_type)
      :unknown
    end

    def run
      eval
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tensor_stream-0.1.5 lib/tensor_stream/control_flow.rb