espnet.nets.pytorch_backend.wavenet.OneHot
Less than 1 minute
espnet.nets.pytorch_backend.wavenet.OneHot
class espnet.nets.pytorch_backend.wavenet.OneHot(depth)
Bases: Module
Convert to one-hot vector.
- Parameters:depth (int) – Dimension of one-hot vector.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(x)
Calculate forward propagation.
- Parameters:x (LongTensor) – long tensor variable with the shape (B, T)
- Returns: float tensor variable with the shape (B, depth, T)
- Return type: Tensor