HyperGP.tensor.ones#
- ones(shape, dtype=<class 'HyperGP.src.data_type._float64'>, device_id=0)[source]#
Generate a new array with given shape and dtype, filled with one
- Parameters:
shape (tuple) – the shape of the new ‘Tensor’ array
dtype – The desired dtype of the new ‘Tensor’ array. Default is HyperGP.float64
device_id (int) – The id of a device in which a new array to be loaded. Default is the first workable device id.
- Returns:
ret(boolean)
Examples
import modules
>>> import numpy as np >>> from HyperGP import Tensor >>> import time
array initialization
>>> x1 = HyperGP.ones((500, 100000)) >>> print("x1: ", x1)