Sha256: 6805af1997a4ac949850cae763ac54f3f2048ee8a07d55affbe555374ade6d22

Contents?: true

Size: 535 Bytes

Versions: 2

Compression:

Stored size: 535 Bytes

Contents

module TensorStream
  class Placeholder < Tensor
    def initialize(data_type, rank, shape, options = {})
      @data_type = data_type
      @rank = rank
      @shape = TensorShape.new(shape, rank)
      @value = nil
      @is_const = false
      @source = set_source(caller_locations)
      @graph = options[:graph] || TensorStream.get_default_graph
      @name = options[:name] || build_name
      @graph.add_node(self)
    end

    private

    def build_name
      "Placeholder#{Tensor.placeholder_name}:#{@rank}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tensor_stream-0.1.1 lib/tensor_stream/placeholder.rb
tensor_stream-0.1.0 lib/tensor_stream/placeholder.rb