View source: R/backend-common.R
transform_to_tensor | R Documentation |
Converts a numeric vector, as delivered by the backend, into a torch_tensor
of shape (channels x samples).
If provided by the backend, attributes "channels" and "sample_rate" will be used.
transform_to_tensor(
audio,
out = NULL,
normalization = TRUE,
channels_first = TRUE
)
audio |
(numeric): A numeric vector, as delivered by the backend. |
out |
(Tensor): An optional output tensor to use instead of creating one. (Default: |
normalization |
(bool, float or function): Optional normalization.
If boolean |
channels_first |
(bool): Set channels first or length first in result. (Default: |
list(Tensor, int), containing - the audio content, encoded as `[C x L]` or `[L x C]` where L is the number of audio frames and C is the number of channels - the sample rate of the audio (as listed in the metadata of the file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.