Class: TensorStream::ControlFlow
- Defined in:
- lib/tensor_stream/control_flow.rb
Instance Attribute Summary collapse
-
#ops ⇒ Object
Returns the value of attribute ops.
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
-
#initialize(flow_type, items, ops = nil, options = {}) ⇒ ControlFlow
constructor
A new instance of ControlFlow.
- #run ⇒ Object
- #set_data_type(passed_data_type) ⇒ Object
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, = {}) @operation = :"flow_#{flow_type}" @items = items @name = set_name @ops = ops @source = set_source(caller_locations) @graph = [:graph] || TensorStream.get_default_graph @graph.add_node(self) end |
Instance Attribute Details
#ops ⇒ Object
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
#run ⇒ Object
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 |