module Bottle::Internal::Comparison
Extended Modules
Defined in:
util/testing.crInstance Method Summary
-
#allclose(a : BaseArray(U), b : BaseArray(U), rtol = 1e-5, atol = 1e-8) forall U
Asserts that two equally shaped
Tensor
s are equal within a provided tolerance.
Instance Method Detail
Asserts that two equally shaped Tensor
s are equal within a provided
tolerance. Useful for floating point comparison where direct equality might
not work
t = Tensor.new([2, 2, 3]) { |i| i * 1.0 }
tf = t + 0.00000000001
allclose(t, tf) # => true