similiar to all.equal()

tch_allclose(x, other, rtol = 1e-05, atol = 1e-08, equal_nan = FALSE)

Arguments

other

tensor to comparte

rtol

tolerance

atol

tolerance

equal_nan

compare nans?

Examples

x <- tensor(c(1,2,3,4,5)) y <- tensor(1:5 + 1e-6) tch_allclose(x, y)
#> [1] TRUE