refactor profiling optional (#47667)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47667

Test Plan: Imported from OSS

Reviewed By: anjali411, ngimel

Differential Revision: D25255572

Pulled By: Krovatkin

fbshipit-source-id: d0152c9ef5b1994e27be9888bcb123dca3ecd88f
This commit is contained in:
jiej
2021-01-22 14:43:04 -08:00
committed by Facebook GitHub Bot
parent f0e72e54cc
commit dd1c2a06b7
15 changed files with 143 additions and 117 deletions

View File

@ -790,9 +790,6 @@ struct CodeImpl {
insertInstruction(PROFILE_OP, profile_function_table_.size());
if (node->cast<ProfileOp>()) {
profile_function_table_.push_back(node->cast<ProfileOp>()->getCallback());
} else if (node->cast<ProfileOptionalOp>()) {
profile_function_table_.push_back(
node->cast<ProfileOptionalOp>()->getCallback());
} else if (node->cast<ProfileIValueOp>()) {
profile_function_table_.push_back(
node->cast<ProfileIValueOp>()->getCallback());
@ -955,7 +952,6 @@ struct CodeImpl {
emitBailOut(node);
break;
case prim::profile_ivalue:
case prim::profile_optional:
case prim::profile:
emitProfile(node);
break;