onnx_chainer.testing.input_generator.increasing

onnx_chainer.testing.input_generator.increasing(*shape, dtype=<class 'numpy.float32'>)

Returns a monotonically increasing ndarray for test inputs.

The output will contain both zero, negative numbers, and non integer numbers for float dtypes. A test writer is supposed to consider this function first.

Example:

>>> onnx_chainer.testing.input_generator.increasing(3, 4)
array([[-3. , -2.5, -2. , -1.5],
       [-1. , -0.5,  0. ,  0.5],
       [ 1. ,  1.5,  2. ,  2.5]], dtype=float32)
Parameters
  • shape (tuple of int) – The shape of the output array.

  • dtype (numpy.dtype) – The dtype of the output array.

Returns

numpy.ndarray