c10::optional -> std::optional in a few places (#144340)

Test Plan: Sandcastle

Pull Request resolved: https://github.com/pytorch/pytorch/pull/144340
Approved by: https://github.com/malfet
This commit is contained in:
Richard Barnes
2025-01-07 21:09:38 +00:00
committed by PyTorch MergeBot
parent f4969c8235
commit 3beb7006dd

View File

@ -275,7 +275,7 @@ Tensor data_parallel(
return module->forward(std::move(input)).to(*output_device);
}
autograd::Scatter scatter(*devices, /*chunk_sizes=*/nullopt, dim);
autograd::Scatter scatter(*devices, /*chunk_sizes=*/std::nullopt, dim);
auto scattered_inputs = fmap<Tensor>(scatter.apply({std::move(input)}));
// Input tensor might not be big enough to scale across all available devices
if (scattered_inputs.size() < devices->size()) {