Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/tensorflow/extensions/array.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/tensorflow/extensions/array.rb', line 10

def ==(other)
  if other.kind_of?(Numo::NArray)
    self.eql?(other.to_a)
  else
    original_equals(other)
  end
end

#original_equalsObject

Helper method to make writing tests easier. Allows this to work:

assert_equal([1,2], Numo::Array[1,2])

Versus having to do this:

assert_equal([1,2], Numo::Array[1,2].to_a)


9
# File 'lib/tensorflow/extensions/array.rb', line 9

alias :original_equals :==