Update Dispatcher.cpp (#95589)

Update Dispatcher.cpp
Pull Request resolved: https://github.com/pytorch/pytorch/pull/95589
Approved by: https://github.com/ezyang
This commit is contained in:
chenxujun
2023-02-28 03:46:03 +00:00
committed by PyTorch MergeBot
parent 3944e7c3e8
commit 49ba11962e

View File

@ -329,7 +329,7 @@ RegistrationHandleRAII Dispatcher::registerFallback(DispatchKey dispatchKey, Ker
backendFallbackKernels_[idx].debug, ", new registration ", debug
);
// NB: inferred function schema is always nullptr for fallbacks, as fallbacks
// cannot be unobxed
// cannot be unboxed
backendFallbackKernels_[idx] = impl::AnnotatedKernel(std::move(kernel), nullptr, std::move(debug));
for (auto& op : operators_) {
@ -403,7 +403,7 @@ std::vector<OperatorName> Dispatcher::getRegistrationsForDispatchKey(c10::option
int64_t Dispatcher::sequenceNumberForRunningRecordFunction(DispatchKey dispatchKey) {
int64_t seq_num = -1;
// Setting sequence number in the Autograd case to associate
// the forward range with the coresponding Autograd's node
// the forward range with the corresponding Autograd's node
if (isIncludedInAlias(dispatchKey, DispatchKey::Autograd) && at::GradMode::is_enabled()) {
seq_num = at::sequence_number::peek();
}
@ -416,7 +416,7 @@ void Dispatcher::runRecordFunction(at::RecordFunction& guard, at::RecordFunction
void Dispatcher::runRecordFunction(at::RecordFunction& guard, at::RecordFunction::schema_ref_t schema_ref, DispatchKey dispatchKey) {
// Setting sequence number in the Autograd case to associate
// the forward range with the coresponding Autograd's node
// the forward range with the corresponding Autograd's node
guard.before(schema_ref, sequenceNumberForRunningRecordFunction(dispatchKey));
}