chainer.backend.get_array_module

chainer.backend.get_array_module(*args)[source]

Gets an appropriate one from numpy, cupy, or chainerx.

This function will return their data arrays’ array module for Variable arguments.

Parameters
  • args – Values to determine whether NumPy, CuPy, or ChainerX should be

  • used.

Returns

cupy, numpy, or chainerx is returned based on the types of the arguments.

Return type

module