Method almostEqual
static member almostEqual: Tensor<'T> * Tensor<'T> * 'T option * 'T option -> bool
Checks if two tensors have the same (within machine precision) values in all elements.
Declaration
static member almostEqual: a:Tensor<'T> * b:Tensor<'T> * absTol:'T option * relTol:'T option -> bool
Parameters
Type | Name | Description |
---|---|---|
Tensor<'T> | a | The tensor on the left side of this binary operation. |
Tensor<'T> | b | The tensor on the right side of this binary operation. |
'T option | absTol | The absolute tolerance. (default 1e-8) |
'T option | relTol | The relative tolerance. (default 1e-5) |
Returns
Type | Description |
---|---|
bool | true if two tensors have same (within specified precision) values in all elements, otherwise false. |
Remarks
Test each element of tensor a
for being almost equal to the corresponding element
of tensor b
. For integer data types the check is exact.
If tensors have different shape, then false is returned.
The tensors a
and b
must have the same storage and type.