Skip to contents

Functions generates a random test tensor that can be used for testing methods and functions based on 'PyTorch'. The tensors have the shape (Batch, Times,Features).

Usage

generate_tensors(times, features, seq_len, pad_value)

Arguments

times

int Maximal length of a sequence.

features

int Number of features of the sequence.

seq_len

Numeric vector containing the length of the given cases. The length of this vector determines the value for 'Batch'. Values must be at least 1 and maximal times.

pad_value

int Value used to indicate padding.

Value

Returns an object of class Tensor from 'PyTorch'.

Note

To request a R array please use generate_embeddings.