gemini-code-assist[bot] commented on code in PR #18620:
URL: https://github.com/apache/tvm/pull/18620#discussion_r2648885513
##########
tests/python/relax/test_op_gradient_numeric.py:
##########
@@ -781,8 +781,9 @@ def test_nll_loss_no_batch(target, dev, nll_reduction1,
nll_weighted1, nll_ignor
@tvm.testing.parametrize_targets("llvm")
def test_conv2d(target, dev, c2d_shape1, c2d_shape2, c2d_kwargs):
- data1_numpy = np.random.uniform(0, 3, c2d_shape1).astype(np.float32)
- data2_numpy = np.random.uniform(0, 3, c2d_shape2).astype(np.float32)
+ # Use smaller range to reduce numerical errors in gradient check
+ data1_numpy = np.random.uniform(0, 2, c2d_shape1).astype(np.float32)
+ data2_numpy = np.random.uniform(0, 2, c2d_shape2).astype(np.float32)
Review Comment:

The pull request description states that the input range is reduced to `(0,
1)`, but the implementation changes it to `(0, 2)`. To align with the
description and further improve numerical stability, I recommend using `(0, 1)`.
```suggestion
data1_numpy = np.random.uniform(0, 1, c2d_shape1).astype(np.float32)
data2_numpy = np.random.uniform(0, 1, c2d_shape2).astype(np.float32)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]