nnmnkwii.util.apply_each2d_padded

nnmnkwii.util.apply_each2d_padded(func2d, X, lengths, *args, **kwargs)[source]

Apply function for each padded 2d slice.

Parameters
  • func2d (Function) – Function applied multiple times for each 2d slice.

  • X (numpy.ndarray) – Input 3d array of shape (N x T x D)

  • lengths (array_like) – Lengths for each 2d slice

Returns

Output array (N x T x D')

Return type

numpy.ndarray