Template Function librapid::ones#

Function Documentation#

template<typename Scalar = double, typename Device = device::CPU, typename T = size_t, size_t N = 32>
Array<Scalar, Device> librapid::ones(const Shape<T, N> &shape)#

Create an Array filled with ones.

Create an array with a specified shape, scalar type and device, and fill it with ones.

Template Parameters
  • Scalar – Scalar type of the Array

  • Device – Device type of the Array

  • T – Scalar type of the Shape

  • N – Maximum number of dimensions of the Shape

Parameters

shapeShape of the Array

Returns

Array filled with ones