chainer.as_array

chainer.as_array(obj)[source]

Returns the underlying array from a variable or an array.

This is a convenient function to get the underlying array object transparently from an object that could be either a variable or an array.

Parameters

obj (N-dimensional array or ~chainer.Variable) – An array or a variable.

Returns

The underlying array object of the argument.

Return type

N-dimensional array or ~chainer.Variable