class TensorStream::Placeholder

Class that defines a TensorStream placeholder

Public Class Methods

new(data_type, rank, shape, options = {}) click to toggle source
# File lib/tensor_stream/placeholder.rb, line 4
def initialize(data_type, rank, shape, options = {})
  setup_initial_state(options)

  @data_type = DataTypeUtils.norm_dtype(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

Public Instance Methods

inspect() click to toggle source
# File lib/tensor_stream/placeholder.rb, line 17
def inspect
  "Placeholder(#{@name} shape: #{@shape || "?"} data_type: #{@data_type})"
end

Private Instance Methods

build_name() click to toggle source
# File lib/tensor_stream/placeholder.rb, line 23
def build_name
  "Placeholder#{graph.get_placeholder_counter}"
end