assert_allclose
函数功能
比较指定tensor的值与期望值是否在一定精度范围内。
函数原型
def assert_allclose(tensor, desired, tol=[1e-7, 1e-7]):
参数说明
参数名 |
类型 |
说明 |
---|---|---|
tensor |
Tensor |
The tensor to be compared. 需要进行比对的Tensor。 |
desired |
numpy.ndarray |
期望数据。 |
tol |
List[float, float] |
tol=[rtol, atol] 即:相对误差(rtol)与绝对误差(atol)组成的列表。 |
返回值
无
约束说明
无
调用示例
请参见调试示例。
父主题: TBE DSL Testing API