mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[Dynamo] Make profiler function will be ignored warn only once (#117585)
Fix #111632 #111622 accidentally reverted #111921, we should bring it back. Pull Request resolved: https://github.com/pytorch/pytorch/pull/117585 Approved by: https://github.com/williamwen42, https://github.com/mlazos, https://github.com/msaroufim
This commit is contained in:
parent
2c5488d719
commit
735715e6d3
|
|
@ -18,6 +18,7 @@ import torch._refs
|
|||
import torch.fx
|
||||
import torch.nn
|
||||
import torch.onnx.operators
|
||||
from torch._logging import warning_once
|
||||
|
||||
from .. import config, polyfill, variables
|
||||
from ..device_interface import get_registered_device_interfaces
|
||||
|
|
@ -187,7 +188,7 @@ class TorchCtxManagerClassVariable(BaseTorchVariable):
|
|||
torch.autograd.profiler.profile,
|
||||
torch.autograd.profiler.record_function,
|
||||
):
|
||||
log.warning("Profiler function %s will be ignored", self.value)
|
||||
warning_once(log, "Profiler function %s will be ignored", self.value)
|
||||
return NullContextVariable()
|
||||
elif self.value is torch._C.DisableTorchFunctionSubclass:
|
||||
assert not (args or kwargs)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user