HyperGP.tensor.full

Contents

HyperGP.tensor.full#

full(shape, fill_value, dtype=None, device_id=0)[source]#

Generate a new array with given shape and dtype, filled with given ‘fill_value’

Parameters:
  • shape (tuple) – the shape of the new ‘Tensor’ array

  • fill_value (float) – The value to be filled in the new 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.full((500, 100000), fill_value=0.24)
>>> print("x1: ", x1)