generate_embeddings: Generate test embeddings

View source: R/utils_test_that.R

generate_embeddingsR Documentation

Generate test embeddings

Description

Functions generates a random test embedding that can be used for testing methods and functions. The embeddings have the shape (Batch, Times,Features).

Usage

generate_embeddings(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 array with dim ⁠(length(seq_len),times,features)⁠.

Note

To generate a 'PyTorch' object please use generate_tensors.

See Also

Other Utils TestThat Developers: check_adjust_n_samples_on_CI(), generate_args_for_tests(), generate_tensors(), get_current_args_for_print(), get_fixed_test_tensor(), get_test_data_for_classifiers(), monitor_test_time_on_CI(), random_bool_on_CI()


aifeducation documentation built on Nov. 19, 2025, 5:08 p.m.