torch.cuda.profiler.profile
-
torch.cuda.profiler.profile()[исходный код] -
Включить профилирование.
Менеджер контекста для включения сбора профиля активным инструментом профилирования из бэкенда CUDA. .. rubric:: Пример
>>> import torch >>> model = torch.nn.Linear(20, 30).cuda() >>> inputs = torch.randn(128, 20).cuda() >>> with torch.cuda.profiler.profile() as prof: ... model(inputs)
© 2026, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.14/generated/torch.cuda.profiler.profile.html