From 9f10306b3fd8168a100e749716e99b75b769e3ef Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Tue, 14 May 2024 13:49:10 -0400 Subject: [PATCH] [codemod] c10::optional -> std::optional in pyspeech/experimental/csrc/decoders/TransducerDecoder.h +20 Differential Revision: D57294284 Pull Request resolved: https://github.com/pytorch/audio/pull/3793 --- docs/source/libtorio.stream_reader.rst | 2 +- docs/source/libtorio.stream_writer.rst | 2 +- src/libtorchaudio/rnnt/autograd.cpp | 2 +- src/libtorchaudio/rnnt/compute.cpp | 2 +- src/libtorchaudio/rnnt/compute.h | 2 +- src/libtorchaudio/rnnt/cpu/compute.cpp | 4 ++-- src/libtorchaudio/rnnt/gpu/compute.cu | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/source/libtorio.stream_reader.rst b/docs/source/libtorio.stream_reader.rst index 6b98489c45..5a634cebc2 100644 --- a/docs/source/libtorio.stream_reader.rst +++ b/docs/source/libtorio.stream_reader.rst @@ -24,7 +24,7 @@ StreamingMediaDecoder .. doxygenclass:: torio::io::StreamingMediaDecoder -.. doxygenfunction:: torio::io::StreamingMediaDecoder::StreamingMediaDecoder(const std::string &src, const c10::optional &format = {}, const c10::optional &option = {}) +.. doxygenfunction:: torio::io::StreamingMediaDecoder::StreamingMediaDecoder(const std::string &src, const std::optional &format = {}, const c10::optional &option = {}) StreamingMediaDecoderCustomIO ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/source/libtorio.stream_writer.rst b/docs/source/libtorio.stream_writer.rst index 99eb8ee7c3..3447e0c528 100644 --- a/docs/source/libtorio.stream_writer.rst +++ b/docs/source/libtorio.stream_writer.rst @@ -24,7 +24,7 @@ StreamingMediaEncoder .. doxygenclass:: torio::io::StreamingMediaEncoder -.. doxygenfunction:: torio::io::StreamingMediaEncoder::StreamingMediaEncoder(const std::string &dst, const c10::optional &format = {}) +.. doxygenfunction:: torio::io::StreamingMediaEncoder::StreamingMediaEncoder(const std::string &dst, const std::optional &format = {}) StreamingMediaEncoderCustomIO ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/libtorchaudio/rnnt/autograd.cpp b/src/libtorchaudio/rnnt/autograd.cpp index 17f4089bd8..7aa63a2bec 100644 --- a/src/libtorchaudio/rnnt/autograd.cpp +++ b/src/libtorchaudio/rnnt/autograd.cpp @@ -42,7 +42,7 @@ class RNNTLossFunction : public torch::autograd::Function { } }; -std::tuple> rnnt_loss_autograd( +std::tuple> rnnt_loss_autograd( torch::Tensor& logits, const torch::Tensor& targets, const torch::Tensor& logit_lengths, diff --git a/src/libtorchaudio/rnnt/compute.cpp b/src/libtorchaudio/rnnt/compute.cpp index 6e6905a3c8..5e6aba133d 100644 --- a/src/libtorchaudio/rnnt/compute.cpp +++ b/src/libtorchaudio/rnnt/compute.cpp @@ -1,7 +1,7 @@ #include #include -std::tuple> rnnt_loss( +std::tuple> rnnt_loss( torch::Tensor& logits, const torch::Tensor& targets, const torch::Tensor& logit_lengths, diff --git a/src/libtorchaudio/rnnt/compute.h b/src/libtorchaudio/rnnt/compute.h index 0508cec80e..ed2dd0c37e 100644 --- a/src/libtorchaudio/rnnt/compute.h +++ b/src/libtorchaudio/rnnt/compute.h @@ -2,7 +2,7 @@ #include -std::tuple> rnnt_loss( +std::tuple> rnnt_loss( torch::Tensor& logits, const torch::Tensor& targets, const torch::Tensor& logit_lengths, diff --git a/src/libtorchaudio/rnnt/cpu/compute.cpp b/src/libtorchaudio/rnnt/cpu/compute.cpp index 91310042c2..097b4bd7e1 100644 --- a/src/libtorchaudio/rnnt/cpu/compute.cpp +++ b/src/libtorchaudio/rnnt/cpu/compute.cpp @@ -6,7 +6,7 @@ namespace rnnt { namespace cpu { // Entry point into RNNT Loss -std::tuple> compute( +std::tuple> compute( torch::Tensor& logits, const torch::Tensor& targets, const torch::Tensor& logit_lengths, @@ -89,7 +89,7 @@ std::tuple> compute( torch::Tensor costs = torch::empty( options.batchSize_ * options.nHypos_, torch::TensorOptions().device(logits.device()).dtype(logits.dtype())); - c10::optional gradients = torch::zeros_like(logits); + std::optional gradients = torch::zeros_like(logits); torch::Tensor int_workspace = torch::empty( IntWorkspace::ComputeSizeFromOptions(options), diff --git a/src/libtorchaudio/rnnt/gpu/compute.cu b/src/libtorchaudio/rnnt/gpu/compute.cu index be3a0ec9ea..43dae68027 100644 --- a/src/libtorchaudio/rnnt/gpu/compute.cu +++ b/src/libtorchaudio/rnnt/gpu/compute.cu @@ -7,7 +7,7 @@ namespace rnnt { namespace gpu { // Entry point into RNNT Loss -std::tuple> compute( +std::tuple> compute( torch::Tensor& logits, const torch::Tensor& targets, const torch::Tensor& logit_lengths, @@ -92,7 +92,7 @@ std::tuple> compute( torch::Tensor costs = torch::empty( options.batchSize_ * options.nHypos_, torch::TensorOptions().device(logits.device()).dtype(logits.dtype())); - c10::optional gradients = torch::zeros_like(logits); + std::optional gradients = torch::zeros_like(logits); torch::Tensor int_workspace = torch::empty( IntWorkspace::ComputeSizeFromOptions(options),