sparse_tensor

# Import statement

from hottbox.utils.generation import sparse_tensor
sparse_tensor(shape, distr='uniform', distr_type=0, fxdind=None, pct=0.05)[source]

Generates a sparse tensor of any dimension and fills it accordingly

Parameters
shapetuple

Specifies the dimensions of the tensor

distrstr, optional

Specifies the random generation using a class of the numpy.random module

distr_typeint, optional

Number of indices to not fix. 0 will be applied globally, 1 will apply to fibers, 2 to slices, etc.

pctfloat, optional

Percentage of the dataset to be filled

Returns
Tensor

Generated tensor according to the parameters specified