Class: TensorStream::Placeholder
- Defined in:
- lib/tensor_stream/placeholder.rb
Overview
Class that defines a TensorStream placeholder
Instance Attribute Summary
Attributes inherited from Tensor
#breakpoint, #consumers, #data_type, #device, #given_name, #graph, #internal, #is_const, #name, #native_buffer, #outputs, #rank, #shape, #source, #value
Instance Method Summary collapse
-
#initialize(data_type, rank, shape, options = {}) ⇒ Placeholder
constructor
A new instance of Placeholder.
Methods inherited from Tensor
#!=, #*, #**, #+, #-, #-@, #/, #<, #<=, #==, #>, #>=, #[], #and, #auto_math, #breakpoint!, cast_dtype, #collect, detect_type, #dot, #dtype, #eval, #first, #internal?, #matmul, #op, #print!, reset_counters, #to_a, #to_f, #to_h, #to_i, #to_math, #to_s
Methods included from OpHelper
#_op, #cons, #dtype_eval, #format_source, #fp_type?, #i_cons, #i_op, #shape_eval, #val_to_dtype
Constructor Details
#initialize(data_type, rank, shape, options = {}) ⇒ Placeholder
Returns a new instance of Placeholder.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/tensor_stream/placeholder.rb', line 4 def initialize(data_type, rank, shape, = {}) setup_initial_state() @data_type = data_type.to_sym @rank = rank @shape = TensorShape.new(shape, rank) @value = nil @is_const = false @name = [@graph.get_name_scope, [:name] || build_name].compact.reject(&:empty?).join('/') @graph.add_node(self) end |