AI::MXNet::TestUtils - Convenience subs used in tests.
same
Test if two pdl arrays are the same
Parameters
----------
a : pdl
b : pdl
allclose
Test if all elements of two pdl arrays are almost equal
Parameters
----------
a : pdl
b : pdl
reldiff
Calculate the relative difference between two input arrays
Calculated by :math:`\\frac{|a-b|_1}{|a|_1 + |b|_1}`
Parameters
----------
a : pdl
b : pdl
almost_equal
Test if two pdl arrays are almost equal.
check_consistency
Check symbol gives the same output for different running context
Parameters
----------
sym : Symbol or list of Symbols
symbol(s) to run the consistency test
ctx_list : list
running context. See example for more detail.
scale : float, optional
standard deviation of the inner normal distribution. Used in initialization
grad_req : str or list of str or dict of str to str
gradient requirement.
same_array
Check whether two NDArrays sharing the same memory block
Parameters
----------
array1 : NDArray
First NDArray to be checked
array2 : NDArray
Second NDArray to be checked
Returns
-------
bool
Whether two NDArrays share the same memory
Module Install Instructions
To install AI::MXNet, copy and paste the appropriate command in to your terminal.