Class: TensorStream::ControlFlow

Inherits:
Operation show all
Defined in:
lib/tensor_stream/control_flow.rb

Instance Attribute Summary collapse

Attributes inherited from Operation

#items, #name, #operation, #options, #rank

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 Operation

empty_matrix?, operation_counter, reset_counters, #to_h, #to_math, #to_s

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(flow_type, items, ops = nil, options = {}) ⇒ ControlFlow

Returns a new instance of ControlFlow.



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

def initialize(flow_type, items, ops = nil, options = {})
  @operation = :"flow_#{flow_type}"
  @items = items
  @name = set_name
  @ops = ops
  @source = set_source(caller_locations)
  @graph = options[:graph] || TensorStream.get_default_graph
  @graph.add_node(self)
end

Instance Attribute Details

#opsObject

Returns the value of attribute ops.



3
4
5
# File 'lib/tensor_stream/control_flow.rb', line 3

def ops
  @ops
end

Instance Method Details

#runObject



19
20
21
# File 'lib/tensor_stream/control_flow.rb', line 19

def run
  eval
end

#set_data_type(passed_data_type) ⇒ Object



15
16
17
# File 'lib/tensor_stream/control_flow.rb', line 15

def set_data_type(passed_data_type)
  :unknown
end