* [Topi][Testing] Minor cleanup for python reference implementations
- Use input dtype for dilate/conv2d accumulate in python
impl. Previously, the python implementations of dilation and conv2d
would use numpy default dtype in some cases, rather than the input
data's dtype.
- Added fallback for datatypes not supported by scipy.signal.convolve2d (e.g. float16).
- Refactored to avoid duplication, use common get_pad_tuple functionality.
* [Topi][UnitTests] Added float16 tests to test_topi_dense.py
* [Topi][UnitTests] Added float16 to test_topi_conv2d_nchw.py
* [Topi][Float16] Added float16 tests for depthwise conv2d.
* [UnitTests] Explicitly set seed for float16 tests
Intended to avoid flaky test failures later due to rounding errors.
* [UnitTests] Fixed a few failing unit tests.
- ref_data must be a test fixture, not acquired through
request.getfixturevalue, in order to have the random_seed be known.
- dilate_python's return value didn't follow `out_dtype`.
- The test_topi_conv3d tests had the reference results computed in
float64, due to dilate_python() not respecting the input data type.
With the correct dtype, the tolerances needed to be slightly widened.
Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
* Added dilation_value attribute to dilate operator of Relay/TOPI.
(Enables custom value for dilation, instead of always 0)
* Added tests for dilation_value of dilate operator in Relay and TOPI.