chainer.backend.get_array_module

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

Gets an appropriate NumPy-compatible module to process arguments

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

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

Return type

module