lib/tensor_stream/evaluator/ruby_evaluator.rb
# multi array ops on ruby arrays with same sizes
multi array ops on ruby arrays with same sizes
multi array ops on ruby arrays with same sizes
def multi_array_op(func, *args)
        elem = args[0]
        if (elem.is_a?(Array))
          elem.each_with_index.collect do |item, index|
            indexed_args = args.collect { |a| a[index] }
            multi_array_op(func, *indexed_args)
          end
        else
          func.call(*args)
        end
      end
def multi_array_op ( func , * args ) elem = args [ 0 ] if ( elem . is_a? ( Array ) ) elem . each_with_index . collect do | item , index | indexed_args = args . collect { | a | a [ index ] } multi_array_op ( func , * indexed_args ) end else func . call ( * args ) end end
multi array ops on ruby arrays with same sizes
multi array ops on ruby arrays with same sizes
func
<not_specific>
args
<not_specific>