Unverified Commit 78d41d57 authored by moto's avatar moto Committed by GitHub
Browse files

[doc] Fix return type of wav2vec2 model (#1790)

parent b2e9f1e4
...@@ -59,13 +59,13 @@ class Wav2Vec2Model(Module): ...@@ -59,13 +59,13 @@ class Wav2Vec2Model(Module):
intermediate layers are returned. intermediate layers are returned.
Returns: Returns:
List of Tensor: List of Tensors and an optional Tensor:
Features from corresponding layers. List of Tensors
Shape: ``(batch, frames, feature dimention)`` Features from requested layers.
Tensor, optional: Each Tensor is of shape: ``(batch, frames, feature dimention)``
Indicates the valid length of each feature in the batch, computed Tensor or None
based on the given ``lengths`` argument. If ``lengths`` argument was provided, a Tensor of shape ``(batch, )``
Shape: ``(batch, )``. is retuned. It indicates the valid length of each feature in the batch.
""" """
x, lengths = self.feature_extractor(waveforms, lengths) x, lengths = self.feature_extractor(waveforms, lengths)
x = self.encoder.extract_features(x, lengths, num_layers) x = self.encoder.extract_features(x, lengths, num_layers)
...@@ -85,13 +85,13 @@ class Wav2Vec2Model(Module): ...@@ -85,13 +85,13 @@ class Wav2Vec2Model(Module):
Shape: ``(batch, )``. Shape: ``(batch, )``.
Returns: Returns:
Tensor: Tensor and an optional Tensor:
Tensor
The sequences of probability distribution (in logit) over labels. The sequences of probability distribution (in logit) over labels.
Shape: ``(batch, frames, num labels)``. Shape: ``(batch, frames, num labels)``.
Tensor, optional: Tensor or None
Indicates the valid length of each feature in the batch, computed If ``lengths`` argument was provided, a Tensor of shape ``(batch, )``
based on the given ``lengths`` argument. is retuned. It indicates the valid length of each feature in the batch.
Shape: ``(batch, )``.
""" """
x, lengths = self.feature_extractor(waveforms, lengths) x, lengths = self.feature_extractor(waveforms, lengths)
x = self.encoder(x, lengths) x = self.encoder(x, lengths)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment