Sha256: 302b94209ee5ec80d33e54894a6da2f4453df7d90f59e5c3fb36ec37d4687de4

Contents?: true

Size: 667 Bytes

Versions: 3

Compression:

Stored size: 667 Bytes

Contents

module TensorStream
  # Class that defines a TensorStream placeholder
  class Placeholder < Tensor
    def initialize(data_type, rank, shape, options = {})
      setup_initial_state(options)

      @data_type = data_type.to_sym
      @rank = rank
      @shape = TensorShape.new(shape, rank)
      @value = nil
      @is_const = false

      @name = [@graph.get_name_scope, options[:name] || build_name].compact.reject(&:empty?).join('/')
      @op = Graph.get_default_graph.add_op!(:placeholder, data_type: @data_type, shape: @shape, internal_name: @name)
    end

    private

    def build_name
      "Placeholder#{graph.get_placeholder_counter}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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