tests/testthat/test-extras.R

test_that("linear_to_mel_frequency and linear_to_mel_frequency", {
  x <- torch_tensor(matrix(1:6, 2))
  x_mel <- linear_to_mel_frequency(x)
  x_linear <- mel_to_linear_frequency(x_mel)

  expect_equal(x, x_linear)
  expect_tensor(x_mel)
  expect_tensor(x_linear)
})

Try the torchaudio package in your browser

Any scripts or data that you put into this service are public.

torchaudio documentation built on Feb. 16, 2023, 9:41 p.m.