chainerx.asarray

chainerx.asarray(a, dtype=None, device=None)

Converts an object to an array.

Parameters
  • a – The source object.

  • dtype – Data type. If omitted, it’s inferred from the input.

  • device (Device) – Device on which the array is allocated. If omitted, the default device is chosen.

Returns

Array interpretation of a. If a is already an ndarray on the given device with matching dtype, no copy is performed.

Return type

ndarray

Warning

If device argument is omitted, the new array is created on the default device, not the device of the input array.

See also

numpy.asarray()