chainerx.linspace

chainerx.linspace(start, stop, num=50, endpoint=True, dtype=None, device=None)

Returns an array with evenly spaced numbers over a specified interval.

Instead of specifying the step width like chainerx.arange(), this function requires the total number of elements specified.

Parameters
  • start – Start of the interval.

  • stop – End of the interval.

  • num – Number of elements.

  • endpoint (bool) – If True, the stop value is included as the last element. Otherwise, the stop value is omitted.

  • dtype – Data type specifier. It is inferred from the start and stop arguments by default.

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

Returns

The 1-D array of ranged values.

Return type

ndarray

See also

numpy.linspace()