mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
See #127836 for details. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127846 Approved by: https://github.com/ezyang ghstack dependencies: #127842, #127843, #127844, #127845
13 lines
483 B
Python
13 lines
483 B
Python
# mypy: allow-untyped-defs
|
|
from torch._C import _get_cpp_backtrace
|
|
|
|
def get_cpp_backtrace(frames_to_skip=0, maximum_number_of_frames=64) -> str:
|
|
r"""
|
|
Return a string containing the C++ stack trace of the current thread.
|
|
|
|
Args:
|
|
frames_to_skip (int): the number of frames to skip from the top of the stack
|
|
maximum_number_of_frames (int): the maximum number of frames to return
|
|
"""
|
|
return _get_cpp_backtrace(frames_to_skip, maximum_number_of_frames)
|