Class: TensorStream::Placeholder

Inherits:
Tensor
  • Object
show all
Defined in:
lib/tensor_stream/placeholder.rb

Instance Attribute Summary

Attributes inherited from Tensor

#breakpoint, #data_type, #given_name, #graph, #internal, #is_const, #name, #native_buffer, #rank, #shape, #source, #value

Instance Method Summary collapse

Methods inherited from Tensor

#!=, #*, #**, #+, #-, #-@, #/, #<, #<=, #==, #>, #>=, #[], #auto_math, #breakpoint!, #build_buffer, cast_dtype, #collect, const_name, detect_type, #dtype, #eval, #first, #internal?, #open_cl_buffer, placeholder_name, reset_counters, #sync_cl_buffer, #to_a, #to_f, #to_h, #to_i, #to_math, #to_s, var_name

Methods included from OpHelper

#cons, #dtype_eval, #i_cons, #i_op, #op, #shape_eval, #val_to_dtype

Constructor Details

#initialize(data_type, rank, shape, options = {}) ⇒ Placeholder

Returns a new instance of Placeholder.



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/tensor_stream/placeholder.rb', line 3

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