magic_intpl#

class diffsptk.MagicNumberInterpolation(magic_number=0)[source]#

See this page for details.

Parameters:
magic_numberfloat [scalar]

Magic number.

forward(x)[source]#

Interpolate magic number.

Parameters:
xTensor [shape=(B, N, D) or (N, D) or (N,)]

Data containing magic number.

Returns:
yTensor [shape=(B, N, D) or (N, D) or (N,)]

Data after interpolation.

Examples

>>> x = torch.tensor([0, 1, 2, 0, 4, 0]).float()
>>> x
tensor([0., 1., 2., 0., 4., 0.])
>>> magic_intpl = diffsptk.MagicNumberInterpolation(0)
>>> y = magic_intpl(x)
>>> y
tensor([1., 1., 2., 3., 4., 4.])

See also

pitch