utils

Helper functions for PyTorch forecasting

Functions

autocorrelation(input[, dim])

Computes the autocorrelation of samples at dimension dim.

get_embedding_size(n)

groupby_apply(keys, values[, bins, …])

Groupby apply for torch tensors

integer_histogram(data[, min, max])

Create histogram of integers in predefined range

next_fast_len(size)

Returns the next largest number n >= size whose prime factors are all 2, 3, or 5.

padded_stack(tensors[, side, mode, value])

Stack tensors along first dimension and pad them along last dimension to ensure their size is equal.

profile(function, profile_fname[, filter, …])

Profile a given function with vmprof.

unpack_sequence(sequence)

Unpack RNN sequence.