Skip to content

Commit 9f10306

Browse files
authored
[codemod] c10::optional -> std::optional in pyspeech/experimental/csrc/decoders/TransducerDecoder.h +20
Differential Revision: D57294284 Pull Request resolved: #3793
1 parent b4407e0 commit 9f10306

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

docs/source/libtorio.stream_reader.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ StreamingMediaDecoder
2424

2525
.. doxygenclass:: torio::io::StreamingMediaDecoder
2626

27-
.. doxygenfunction:: torio::io::StreamingMediaDecoder::StreamingMediaDecoder(const std::string &src, const c10::optional<std::string> &format = {}, const c10::optional<OptionDict> &option = {})
27+
.. doxygenfunction:: torio::io::StreamingMediaDecoder::StreamingMediaDecoder(const std::string &src, const std::optional<std::string> &format = {}, const c10::optional<OptionDict> &option = {})
2828

2929
StreamingMediaDecoderCustomIO
3030
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

docs/source/libtorio.stream_writer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ StreamingMediaEncoder
2424

2525
.. doxygenclass:: torio::io::StreamingMediaEncoder
2626

27-
.. doxygenfunction:: torio::io::StreamingMediaEncoder::StreamingMediaEncoder(const std::string &dst, const c10::optional<std::string> &format = {})
27+
.. doxygenfunction:: torio::io::StreamingMediaEncoder::StreamingMediaEncoder(const std::string &dst, const std::optional<std::string> &format = {})
2828

2929
StreamingMediaEncoderCustomIO
3030
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/libtorchaudio/rnnt/autograd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class RNNTLossFunction : public torch::autograd::Function<RNNTLossFunction> {
4242
}
4343
};
4444

45-
std::tuple<torch::Tensor, c10::optional<torch::Tensor>> rnnt_loss_autograd(
45+
std::tuple<torch::Tensor, std::optional<torch::Tensor>> rnnt_loss_autograd(
4646
torch::Tensor& logits,
4747
const torch::Tensor& targets,
4848
const torch::Tensor& logit_lengths,

src/libtorchaudio/rnnt/compute.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <libtorchaudio/rnnt/compute.h>
22
#include <torch/script.h>
33

4-
std::tuple<torch::Tensor, c10::optional<torch::Tensor>> rnnt_loss(
4+
std::tuple<torch::Tensor, std::optional<torch::Tensor>> rnnt_loss(
55
torch::Tensor& logits,
66
const torch::Tensor& targets,
77
const torch::Tensor& logit_lengths,

src/libtorchaudio/rnnt/compute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <torch/script.h>
44

5-
std::tuple<torch::Tensor, c10::optional<torch::Tensor>> rnnt_loss(
5+
std::tuple<torch::Tensor, std::optional<torch::Tensor>> rnnt_loss(
66
torch::Tensor& logits,
77
const torch::Tensor& targets,
88
const torch::Tensor& logit_lengths,

src/libtorchaudio/rnnt/cpu/compute.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace rnnt {
66
namespace cpu {
77

88
// Entry point into RNNT Loss
9-
std::tuple<torch::Tensor, c10::optional<torch::Tensor>> compute(
9+
std::tuple<torch::Tensor, std::optional<torch::Tensor>> compute(
1010
torch::Tensor& logits,
1111
const torch::Tensor& targets,
1212
const torch::Tensor& logit_lengths,
@@ -89,7 +89,7 @@ std::tuple<torch::Tensor, c10::optional<torch::Tensor>> compute(
8989
torch::Tensor costs = torch::empty(
9090
options.batchSize_ * options.nHypos_,
9191
torch::TensorOptions().device(logits.device()).dtype(logits.dtype()));
92-
c10::optional<torch::Tensor> gradients = torch::zeros_like(logits);
92+
std::optional<torch::Tensor> gradients = torch::zeros_like(logits);
9393

9494
torch::Tensor int_workspace = torch::empty(
9595
IntWorkspace::ComputeSizeFromOptions(options),

src/libtorchaudio/rnnt/gpu/compute.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace rnnt {
77
namespace gpu {
88

99
// Entry point into RNNT Loss
10-
std::tuple<torch::Tensor, c10::optional<torch::Tensor>> compute(
10+
std::tuple<torch::Tensor, std::optional<torch::Tensor>> compute(
1111
torch::Tensor& logits,
1212
const torch::Tensor& targets,
1313
const torch::Tensor& logit_lengths,
@@ -92,7 +92,7 @@ std::tuple<torch::Tensor, c10::optional<torch::Tensor>> compute(
9292
torch::Tensor costs = torch::empty(
9393
options.batchSize_ * options.nHypos_,
9494
torch::TensorOptions().device(logits.device()).dtype(logits.dtype()));
95-
c10::optional<torch::Tensor> gradients = torch::zeros_like(logits);
95+
std::optional<torch::Tensor> gradients = torch::zeros_like(logits);
9696

9797
torch::Tensor int_workspace = torch::empty(
9898
IntWorkspace::ComputeSizeFromOptions(options),

0 commit comments

Comments
 (0)