assert_allclose

Description

Checks the tolerances between the benchmark tensor value and the expected value.

Prototype

def assert_allclose(tensor, desired, tol=[1e-7, 1e-7]):

Parameters

Parameter

Type

Description

tensor

Tensor

Tensor to be compared.

desired

numpy.ndarray

Expected data.

tol

List[float, float]

tol=[rtol, atol]

That is, a list of relative tolerances (rtol) and absolute tolerances (atol).

Default value: [1e-7, 1e-7]

Returns

None

Restrictions

The assert_allclose API supports only the scenario where the data type to be compared is Tensor and the expected data type is numpy.ndarray.

If the data type to be compared is numpy.ndarray, call the tvm.testing.assert_allclose API.

Example

For details, see Debugging Example.