Sha256: 0db12392bd48a16f09767a6ba7f007ea00c88528edaff305d3624b30d992bda8
Contents?: true
Size: 905 Bytes
Versions: 9
Compression:
Stored size: 905 Bytes
Contents
class Array include TensorStream::MonkeyPatch def /(other) TensorStream.convert_to_tensor(self) * other end def %(other) TensorStream.convert_to_tensor(self) % other end def **(other) TensorStream.convert_to_tensor(self)**other end 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 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 end
Version data entries
9 entries across 9 versions & 1 rubygems