class Array

Public Instance Methods

%(other) click to toggle source
# File lib/tensor_stream/monkey_patches/array.rb, line 8
def %(other)
  TensorStream.convert_to_tensor(self) % other
end
**(other) click to toggle source
# File lib/tensor_stream/monkey_patches/array.rb, line 12
def **(other)
  TensorStream.convert_to_tensor(self)**other
end
/(other) click to toggle source
# File lib/tensor_stream/monkey_patches/array.rb, line 4
def /(other)
  TensorStream.convert_to_tensor(self) * other
end
max_index() click to toggle source
# File lib/tensor_stream/monkey_patches/array.rb, line 16
def max_index
  if first.is_a?(Float)
    highest = first
    highest_index = 0
    each_with_index do |item, index|
      next if item.nan?

      if item > highest
        highest = item
        highest_index = index
      end
    end
    highest_index
  else
    index(max)
  end
end
min_index() click to toggle source
# File lib/tensor_stream/monkey_patches/array.rb, line 34
def min_index
  if first.is_a?(Float)
    highest = first
    highest_index = 0
    each_with_index do |item, index|
      next if item.nan?

      if item < highest
        highest = item
        highest_index = index
      end
    end
    highest_index
  else
    index(min)
  end
end