Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[codemod] c10::optional -> std::optional in pyspeech/experimental/csrc/decoders/TransducerDecoder.h +20 #3793

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/libtorio.stream_reader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ StreamingMediaDecoder

.. doxygenclass:: torio::io::StreamingMediaDecoder

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

StreamingMediaDecoderCustomIO
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion docs/source/libtorio.stream_writer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ StreamingMediaEncoder

.. doxygenclass:: torio::io::StreamingMediaEncoder

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

StreamingMediaEncoderCustomIO
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion src/libtorchaudio/rnnt/autograd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RNNTLossFunction : public torch::autograd::Function<RNNTLossFunction> {
}
};

std::tuple<torch::Tensor, c10::optional<torch::Tensor>> rnnt_loss_autograd(
std::tuple<torch::Tensor, std::optional<torch::Tensor>> rnnt_loss_autograd(
torch::Tensor& logits,
const torch::Tensor& targets,
const torch::Tensor& logit_lengths,
Expand Down
2 changes: 1 addition & 1 deletion src/libtorchaudio/rnnt/compute.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <libtorchaudio/rnnt/compute.h>
#include <torch/script.h>

std::tuple<torch::Tensor, c10::optional<torch::Tensor>> rnnt_loss(
std::tuple<torch::Tensor, std::optional<torch::Tensor>> rnnt_loss(
torch::Tensor& logits,
const torch::Tensor& targets,
const torch::Tensor& logit_lengths,
Expand Down
2 changes: 1 addition & 1 deletion src/libtorchaudio/rnnt/compute.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <torch/script.h>

std::tuple<torch::Tensor, c10::optional<torch::Tensor>> rnnt_loss(
std::tuple<torch::Tensor, std::optional<torch::Tensor>> rnnt_loss(
torch::Tensor& logits,
const torch::Tensor& targets,
const torch::Tensor& logit_lengths,
Expand Down
4 changes: 2 additions & 2 deletions src/libtorchaudio/rnnt/cpu/compute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace rnnt {
namespace cpu {

// Entry point into RNNT Loss
std::tuple<torch::Tensor, c10::optional<torch::Tensor>> compute(
std::tuple<torch::Tensor, std::optional<torch::Tensor>> compute(
torch::Tensor& logits,
const torch::Tensor& targets,
const torch::Tensor& logit_lengths,
Expand Down Expand Up @@ -89,7 +89,7 @@ std::tuple<torch::Tensor, c10::optional<torch::Tensor>> compute(
torch::Tensor costs = torch::empty(
options.batchSize_ * options.nHypos_,
torch::TensorOptions().device(logits.device()).dtype(logits.dtype()));
c10::optional<torch::Tensor> gradients = torch::zeros_like(logits);
std::optional<torch::Tensor> gradients = torch::zeros_like(logits);

torch::Tensor int_workspace = torch::empty(
IntWorkspace::ComputeSizeFromOptions(options),
Expand Down
4 changes: 2 additions & 2 deletions src/libtorchaudio/rnnt/gpu/compute.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace rnnt {
namespace gpu {

// Entry point into RNNT Loss
std::tuple<torch::Tensor, c10::optional<torch::Tensor>> compute(
std::tuple<torch::Tensor, std::optional<torch::Tensor>> compute(
torch::Tensor& logits,
const torch::Tensor& targets,
const torch::Tensor& logit_lengths,
Expand Down Expand Up @@ -92,7 +92,7 @@ std::tuple<torch::Tensor, c10::optional<torch::Tensor>> compute(
torch::Tensor costs = torch::empty(
options.batchSize_ * options.nHypos_,
torch::TensorOptions().device(logits.device()).dtype(logits.dtype()));
c10::optional<torch::Tensor> gradients = torch::zeros_like(logits);
std::optional<torch::Tensor> gradients = torch::zeros_like(logits);

torch::Tensor int_workspace = torch::empty(
IntWorkspace::ComputeSizeFromOptions(options),
Expand Down
Loading