PyTorch中的c10::ArrayRef和at::IntArrayRef
PyTorch中的c10::ArrayRef和at::IntArrayRef
- c10::ArrayRef
- using
- 成員變數
- 建構子
- iterator
- 檢查大小的函數
- accessor
- equals
- slice
- at::IntArrayRef
- 被Python端調用
c10::ArrayRef
類如其名,是對array的常量引用(const reference);at::IntArrayRef
也可以顧名思義:它是整數array的常量引用(const reference)。
在調用Pytorch的torch.empty(3, 4)
建立空白張量時,其底層便會用到at::IntArrayRef
。
先來看看c10::ArrayRef
類別的宣告。
c10::ArrayRef
torch/include/c10/util/ArrayRef.h
namespace c10 {
/// ArrayRef - Represent a constant reference to an array (0 or more elements
/// consecutively in memory), i.e. a start pointer and a length. It allows
/// various APIs to take consecutive elements easily and conveniently.
///
/// This class does not own the underlying data, it is expected to be used in
/// situations where the data resides in some other buffer, whose lifetime
/// extends past that of the ArrayRef. For this reason, it is not in general
/// safe to store an ArrayRef.
///
/// This is intended to be trivially copyable, so it should be passed by
/// value.
template <typename T>
class ArrayRef final {public:using iterator = const T*;using const_iterator = const T*;using size_type = size_t;using value_type = T;using reverse_iterator = std::reverse_iterator<iterator>;private:/// The start of the array, in an external buffer.const T* Data;/// The number of elements.size_type Length;void debugCheckNullptrInvariant() {TORCH_INTERNAL_ASSERT_DEBUG_ONLY(Data != nullptr || Length == 0,"created ArrayRef with nullptr and non-zero length! c10::optional relies on this being illegal");}public:/// @name Constructors/// @{/// Construct an empty ArrayRef./* implicit */ constexpr ArrayRef() : Data(nullptr), Length(0) {}/// Construct an ArrayRef from a single element.// TODO Make this explicitconstexpr ArrayRef(const T& OneElt) : Data(&OneElt), Length(1) {}/// Construct an ArrayRef from a pointer and length.C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef(const T* data, size_t length): Data(data), Length(length) {debugCheckNullptrInvariant();}/// Construct an ArrayRef from a range.C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef(const T* begin, const T* end): Data(begin), Length(end - begin) {debugCheckNullptrInvariant();}/// Construct an ArrayRef from a SmallVector. This is templated in order to/// avoid instantiating SmallVectorTemplateCommon<T> whenever we/// copy-construct an ArrayRef.template <typename U>/* implicit */ ArrayRef(const SmallVectorTemplateCommon<T, U>& Vec): Data(Vec.data()), Length(Vec.size()) {debugCheckNullptrInvariant();}template <typename Container,typename = std::enable_if_t<std::is_same<std::remove_const_t<decltype(std::declval<Container>().data())>,T*>::value>>/* implicit */ ArrayRef(const Container& container): Data(container.data()), Length(container.size()) {debugCheckNullptrInvariant();}/// Construct an ArrayRef from a std::vector.// The enable_if stuff here makes sure that this isn't used for// std::vector<bool>, because ArrayRef can't work on a std::vector<bool>// bitfield.template <typename A>/* implicit */ ArrayRef(const std::vector<T, A>& Vec): Data(Vec.data()), Length(Vec.size()) {static_assert(!std::is_same<T, bool>::value,"ArrayRef<bool> cannot be constructed from a std::vector<bool> bitfield.");}/// Construct an ArrayRef from a std::arraytemplate <size_t N>/* implicit */ constexpr ArrayRef(const std::array<T, N>& Arr): Data(Arr.data()), Length(N) {}/// Construct an ArrayRef from a C array.template <size_t N>/* implicit */ constexpr ArrayRef(const T (&Arr)[N]) : Data(Arr), Length(N) {}/// Construct an ArrayRef from a std::initializer_list./* implicit */ constexpr ArrayRef(const std::initializer_list<T>& Vec): Data(std::begin(Vec) == std::end(Vec) ? static_cast<T*>(nullptr): std::begin(Vec)),Length(Vec.size()) {}/// @}/// @name Simple Operations/// @{constexpr iterator begin() const {return Data;}constexpr iterator end() const {return Data + Length;}// These are actually the same as iterator, since ArrayRef only// gives you const iterators.constexpr const_iterator cbegin() const {return Data;}constexpr const_iterator cend() const {return Data + Length;}constexpr reverse_iterator rbegin() const {return reverse_iterator(end());}constexpr reverse_iterator rend() const {return reverse_iterator(begin());}/// empty - Check if the array is empty.constexpr bool empty() const {return Length == 0;}constexpr const T* data() const {return Data;}/// size - Get the array size.constexpr size_t size() const {return Length;}/// front - Get the first element.C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA const T& front() const {TORCH_CHECK(!empty(), "ArrayRef: attempted to access front() of empty list");return Data[0];}/// back - Get the last element.C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA const T& back() const {TORCH_CHECK(!empty(), "ArrayRef: attempted to access back() of empty list");return Data[Length - 1];}/// equals - Check for element-wise equality.constexpr bool equals(ArrayRef RHS) const {return Length == RHS.Length && std::equal(begin(), end(), RHS.begin());}/// slice(n, m) - Take M elements of the array starting at element NC10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef<T> slice(size_t N, size_t M)const {TORCH_CHECK(N + M <= size(),"ArrayRef: invalid slice, N = ",N,"; M = ",M,"; size = ",size());return ArrayRef<T>(data() + N, M);}/// slice(n) - Chop off the first N elements of the array.constexpr ArrayRef<T> slice(size_t N) const {return slice(N, size() - N);}/// @}/// @name Operator Overloads/// @{constexpr const T& operator[](size_t Index) const {return Data[Index];}/// Vector compatibilityC10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA const T& at(size_t Index) const {TORCH_CHECK(Index < Length,"ArrayRef: invalid index Index = ",Index,"; Length = ",Length);return Data[Index];}/// Disallow accidental assignment from a temporary.////// The declaration here is extra complicated so that "arrayRef = {}"/// continues to select the move assignment operator.template <typename U>typename std::enable_if<std::is_same<U, T>::value, ArrayRef<T>>::type&operator=(U&& Temporary) = delete;/// Disallow accidental assignment from a temporary.////// The declaration here is extra complicated so that "arrayRef = {}"/// continues to select the move assignment operator.template <typename U>typename std::enable_if<std::is_same<U, T>::value, ArrayRef<T>>::type&operator=(std::initializer_list<U>) = delete;/// @}/// @name Expensive Operations/// @{std::vector<T> vec() const {return std::vector<T>(Data, Data + Length);}/// @}
};// ...
} // namespace c10
using
首先定義一些別名,待會在函數定義中會時常看到:
public:using iterator = const T*;using const_iterator = const T*;using size_type = size_t;using value_type = T;using reverse_iterator = std::reverse_iterator<iterator>;
ArrayRef
的模板參數為T
,代表陣列元素的型別。
成員變數
private:/// The start of the array, in an external buffer.const T* Data;/// The number of elements.size_type Length;
c10::ArrayRef
的私有成員變數const T* Data
是c10::ArrayRef
這個類別的核心,它代表的是array在記憶體中的起始位置。
簡單來說c10::ArrayRef
就是對const T* Data
,即array的const reference的包裝。
私有成員變數Length
則代表array的長度。
建構子
建構空的ArrayRef
的建構子:
/// @name Constructors/// @{/// Construct an empty ArrayRef./* implicit */ constexpr ArrayRef() : Data(nullptr), Length(0) {}
建構單個元素的ArrayRef
的建構子:
/// Construct an ArrayRef from a single element.// TODO Make this explicitconstexpr ArrayRef(const T& OneElt) : Data(&OneElt), Length(1) {}
由指標和長度建構,注意此處直接將成員變數Data
的值設為入參data
:
/// Construct an ArrayRef from a pointer and length.C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef(const T* data, size_t length): Data(data), Length(length) {debugCheckNullptrInvariant();}
由begin和end指標和建構,注意Length
為end - begin
:
/// Construct an ArrayRef from a range.C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef(const T* begin, const T* end): Data(begin), Length(end - begin) {debugCheckNullptrInvariant();}
由其它容器建構:
/// Construct an ArrayRef from a SmallVector. This is templated in order to/// avoid instantiating SmallVectorTemplateCommon<T> whenever we/// copy-construct an ArrayRef.template <typename U>/* implicit */ ArrayRef(const SmallVectorTemplateCommon<T, U>& Vec): Data(Vec.data()), Length(Vec.size()) {debugCheckNullptrInvariant();}template <typename Container,typename = std::enable_if_t<std::is_same<std::remove_const_t<decltype(std::declval<Container>().data())>,T*>::value>>/* implicit */ ArrayRef(const Container& container): Data(container.data()), Length(container.size()) {debugCheckNullptrInvariant();}/// Construct an ArrayRef from a std::vector.// The enable_if stuff here makes sure that this isn't used for// std::vector<bool>, because ArrayRef can't work on a std::vector<bool>// bitfield.template <typename A>/* implicit */ ArrayRef(const std::vector<T, A>& Vec): Data(Vec.data()), Length(Vec.size()) {static_assert(!std::is_same<T, bool>::value,"ArrayRef<bool> cannot be constructed from a std::vector<bool> bitfield.");}/// Construct an ArrayRef from a std::arraytemplate <size_t N>/* implicit */ constexpr ArrayRef(const std::array<T, N>& Arr): Data(Arr.data()), Length(N) {}/// Construct an ArrayRef from a C array.template <size_t N>/* implicit */ constexpr ArrayRef(const T (&Arr)[N]) : Data(Arr), Length(N) {}/// Construct an ArrayRef from a std::initializer_list./* implicit */ constexpr ArrayRef(const std::initializer_list<T>& Vec): Data(std::begin(Vec) == std::end(Vec) ? static_cast<T*>(nullptr): std::begin(Vec)),Length(Vec.size()) {}
開頭的注釋中說c10::ArrayRef
是對array的const reference,本身並不擁有其底層的資料,所以它的建構子才沒有做底層資料的複製,僅僅紀錄了array的起始位置;另外解構子也不會銷毀Data
所佔用的空間。
iterator
c10::ArrayRef
類別對array做包裝,提供了begin
, end
, cbegin
, cend
, rbegin
, rend
等C++ STL容器也有的iterator:
/// @}/// @name Simple Operations/// @{constexpr iterator begin() const {return Data;}constexpr iterator end() const {return Data + Length;}// These are actually the same as iterator, since ArrayRef only// gives you const iterators.constexpr const_iterator cbegin() const {return Data;}constexpr const_iterator cend() const {return Data + Length;}constexpr reverse_iterator rbegin() const {return reverse_iterator(end());}constexpr reverse_iterator rend() const {return reverse_iterator(begin());}
檢查大小的函數
empty
:
/// empty - Check if the array is empty.constexpr bool empty() const {return Length == 0;}
size
:
/// size - Get the array size.constexpr size_t size() const {return Length;}
accessor
直接回傳底層array const指標的函數:
constexpr const T* data() const {return Data;}
front
函數回傳第一個元素,獲取該元素前會先檢查array的大小:
/// front - Get the first element.C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA const T& front() const {TORCH_CHECK(!empty(), "ArrayRef: attempted to access front() of empty list");return Data[0];}
back
函數回傳最後一個元素,獲取該元素前同樣會先檢查array的大小:
/// back - Get the last element.C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA const T& back() const {TORCH_CHECK(!empty(), "ArrayRef: attempted to access back() of empty list");return Data[Length - 1];}
array原本就有的operation[]
:
/// @}/// @name Operator Overloads/// @{constexpr const T& operator[](size_t Index) const {return Data[Index];}
C++ STL容器有的at
函數:
/// Vector compatibilityC10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA const T& at(size_t Index) const {TORCH_CHECK(Index < Length,"ArrayRef: invalid index Index = ",Index,"; Length = ",Length);return Data[Index];}
equals
比較長度,如果長度一樣,則用std::equal
函數比較底層array內容:
/// equals - Check for element-wise equality.constexpr bool equals(ArrayRef RHS) const {return Length == RHS.Length && std::equal(begin(), end(), RHS.begin());}
slice
slice
函數從起始位置N
開始,取M
個元素構建一個ArrayRef
後回傳:
/// slice(n, m) - Take M elements of the array starting at element NC10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef<T> slice(size_t N, size_t M)const {TORCH_CHECK(N + M <= size(),"ArrayRef: invalid slice, N = ",N,"; M = ",M,"; size = ",size());return ArrayRef<T>(data() + N, M);}
丟棄前N
個元素:
/// slice(n) - Chop off the first N elements of the array.constexpr ArrayRef<T> slice(size_t N) const {return slice(N, size() - N);}
接著來看at::IntArrayRef
。
at::IntArrayRef
torch/include/ATen/core/ATen_fwd.h
at::IntArrayRef
定義如下:
using IntArrayRef = c10::ArrayRef<int64_t>;
at::IntArrayRef
其實是c10::ArrayRef<int64_t>
的別名,其中int64_t
是C++裡就有的型別,代表長度為64 bit的長整數。
此處將ArrayRef
的模板參數設為int_64
表示at::IntArrayRef
底層陣列的元素型別為int_64
。
被Python端調用
PyTorch Python端的torch.empty(3, 4)
對應到C++底層的at::empty
,其定義位於在torch/csrc/autograd/generated/variable_factories.h
:
inline at::Tensor empty(at::IntArrayRef size, c10::optional<at::DimnameList> names, at::TensorOptions options = {}, c10::optional<at::MemoryFormat> memory_format = c10::nullopt) {at::AutoDispatchBelowADInplaceOrView guard;return autograd::make_variable(at::empty(size, names, at::TensorOptions(options).requires_grad(c10::nullopt), memory_format), /*requires_grad=*/options.requires_grad());
}
inline at::Tensor empty(at::IntArrayRef size, at::TensorOptions options = {}, c10::optional<at::MemoryFormat> memory_format = c10::nullopt) {at::AutoDispatchBelowADInplaceOrView guard;return autograd::make_variable(at::empty(size, at::TensorOptions(options).requires_grad(c10::nullopt), memory_format), /*requires_grad=*/options.requires_grad());
}
inline at::Tensor empty_symint(c10::SymIntArrayRef size, at::TensorOptions options = {}, c10::optional<at::MemoryFormat> memory_format = c10::nullopt) {at::AutoDispatchBelowADInplaceOrView guard;return autograd::make_variable(at::empty_symint(size, at::TensorOptions(options).requires_grad(c10::nullopt), memory_format), /*requires_grad=*/options.requires_grad());
}
前兩個empty
函數的第一個參數是at::IntArrayRef
,第三個empty_symint
的第一個參數是c10::SymIntArrayRef
。
編輯torch_int_array_ref.py
如下:
torch.empty(3, 4)
接下來新建一個名為gdbsymintarrayref
的檔案並將以下內容填入其中:
set logging on gdbsymintarrayref.txt
set breakpoint pending on
break at::detail::empty_generic
break at::empty
info breakpoints
run torch_int_array_ref.py
bt
quit
開啟gdb python
,輸入source gdbsymintarrayref
指令執行上述腳本,就會得到以下的backtrace:
#0 0x00007fa5affff699 in c10::ArrayRef<c10::detail::infer_schema::ArgumentDef>::ArrayRef<1ul> (Arr=..., this=<optimized out>)at /root/Documents/pytorch/c10/util/ArrayRef.h:119
#1 c10::detail::infer_schema::createFunctionSchemaFromTraitsFlattenedReturns<c10::guts::function_traits<at::Tensor const& (at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>)> >() () at /root/Documents/pytorch/aten/src/ATen/core/op_registration/infer_schema.h:127
#2 c10::inferFunctionSchemaFlattenedReturns<at::Tensor const& (at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>)>() ()at /root/Documents/pytorch/aten/src/ATen/core/op_registration/infer_schema.h:151
#3 c10::detail::inferFunctionSchemaFromFunctor<at::Tensor const& (c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>)>() () at /root/Documents/pytorch/aten/src/ATen/core/op_registration/op_registration.h:30
#4 0x00007fa5afffa4a0 in torch::CppFunction::CppFunction<c10::CompileTimeFunctionPointer<at::Tensor const& (c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>), &(resize__functionalization(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>))> >(c10::CompileTimeFunctionPointer<at::Tensor const& (c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>), &(resize__functionalization(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>))>, std::enable_if<c10::is_compile_time_function_pointer<c10::CompileTimeFunctionPointer<at::Tensor const& (c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>), &(resize__functionalization(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>))> >::value, decltype(nullptr)>::type) (f=..., this=0x7ffe61de5b50) at /root/Documents/pytorch/torch/library.h:134
#5 torch::Library::impl<char const*, c10::CompileTimeFunctionPointer<at::Tensor const& (c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>), &(resize__functionalization(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>))> >(char const*, c10::CompileTimeFunctionPointer<at::Tensor const& (c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>), &(resize__functionalization(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>, c10::optional<c10::MemoryFormat>))>&&, torch::_RegisterOrVerify) & (raw_f=..., rv=torch::_RegisterOrVerify::REGISTER, name=0x7fa5b6ea3f48 "resize_", this=0x7fa5b8d533e0 <TORCH_LIBRARY_IMPL_static_init_aten_Functionalize_3>) at /root/Documents/pytorch/torch/library.h:661
#6 TORCH_LIBRARY_IMPL_init_aten_Functionalize_3 (m=...) at /root/Documents/pytorch/aten/src/ATen/FunctionalizeFallbackKernel.cpp:295
#7 0x00007fa5affcd387 in torch::detail::TorchLibraryInit::TorchLibraryInit (this=0x7fa5b8d533e0 <TORCH_LIBRARY_IMPL_static_init_aten_Functionalize_3>, kind=torch::Library::IMPL, fn=0x7fa5afffa400 <TORCH_LIBRARY_IMPL_init_aten_Functionalize_3(torch::Library&)>, ns=0x7fa5b6e9ec00 "aten", k=..., file=0x7fa5b6e648c0 "/root/Documents/pytorch/aten/src/ATen/FunctionalizeFallbackKernel.cpp", line=294) at /root/Documents/pytorch/torch/library.h:853
#8 0x00007fa5afef0dc4 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535)at /root/Documents/pytorch/aten/src/ATen/FunctionalizeFallbackKernel.cpp:294
#9 _GLOBAL__sub_I_FunctionalizeFallbackKernel.cpp(void) () at /root/Documents/pytorch/aten/src/ATen/FunctionalizeFallbackKernel.cpp:301
#10 0x00007fa5ed5ad47e in call_init (l=<optimized out>, argc=argc@entry=2, argv=argv@entry=0x7ffe61de8928, env=env@entry=0x1919c70) at ./elf/dl-init.c:70
#11 0x00007fa5ed5ad568 in call_init (env=0x1919c70, argv=0x7ffe61de8928, argc=2, l=<optimized out>) at ./elf/dl-init.c:33
#12 _dl_init (main_map=0x1d43f60, argc=2, argv=0x7ffe61de8928, env=0x1919c70) at ./elf/dl-init.c:117
#13 0x00007fa5ed3f6c85 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>)at ./elf/dl-error-skeleton.c:182
#14 0x00007fa5ed5b4ff6 in dl_open_worker (a=0x7ffe61de5ff0) at ./elf/dl-open.c:808
#15 dl_open_worker (a=a@entry=0x7ffe61de5ff0) at ./elf/dl-open.c:771
#16 0x00007fa5ed3f6c28 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at ./elf/dl-error-skeleton.c:208
#17 0x00007fa5ed5b534e in _dl_open (file=<optimized out>, mode=-2147483646, caller_dlopen=0x5b7616 <_PyImport_FindSharedFuncptr+134>, nsid=-2, argc=2, argv=<optimized out>, env=0x1919c70) at ./elf/dl-open.c:883
#18 0x00007fa5ed3126bc in dlopen_doit (a=a@entry=0x7ffe61de6260) at ./dlfcn/dlopen.c:56
#19 0x00007fa5ed3f6c28 in __GI__dl_catch_exception (exception=exception@entry=0x7ffe61de61c0, operate=<optimized out>, args=<optimized out>) at ./elf/dl-error-skeleton.c:208
#20 0x00007fa5ed3f6cf3 in __GI__dl_catch_error (objname=0x7ffe61de6218, errstring=0x7ffe61de6220, mallocedp=0x7ffe61de6217, operate=<optimized out>, args=<optimized out>) at ./elf/dl-error-skeleton.c:227
#21 0x00007fa5ed3121ae in _dlerror_run (operate=operate@entry=0x7fa5ed312660 <dlopen_doit>, args=args@entry=0x7ffe61de6260) at ./dlfcn/dlerror.c:138
#22 0x00007fa5ed312748 in dlopen_implementation (dl_caller=<optimized out>, mode=<optimized out>, file=0x7fa5eccb9a70 "/root/Documents/pytorch/torch/_C.cpython-39-x86_64-linux-gnu.so") at ./dlfcn/dlopen.c:71
#23 ___dlopen (file=file@entry=0x7fa5eccb9a70 "/root/Documents/pytorch/torch/_C.cpython-39-x86_64-linux-gnu.so", mode=<optimized out>) at ./dlfcn/dlopen.c:81
#24 0x00000000005b7616 in _PyImport_FindSharedFuncptr (prefix=0x63166c "PyInit", shortname=0x7fa5eccb7e00 "_C", pathname=0x7fa5eccb9a70 "/root/Documents/pytorch/torch/_C.cpython-39-x86_64-linux-gnu.so", fp=0x0) at /usr/local/src/conda/python-3.9.13/Python/dynload_shlib.c:100
#25 0x00000000005b6e2d in _PyImport_LoadDynamicModuleWithSpec (fp=0x0, spec=0x7fa5eccc7370) at /usr/local/src/conda/python-3.9.13/Python/importdl.c:137
#26 _imp_create_dynamic_impl (module=<optimized out>, file=<optimized out>, spec=0x7fa5eccc7370) at /usr/local/src/conda/python-3.9.13/Python/import.c:2302
#27 _imp_create_dynamic (module=<optimized out>, args=args@entry=0x7fa5ecdd4a78, nargs=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/clinic/import.c.h:330
#28 0x00000000004f8f94 in cfunction_vectorcall_FASTCALL (func=0x7fa5ed1c8b80, args=0x7fa5ecdd4a78, nargsf=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.9.13/Objects/methodobject.c:430
#29 0x00000000004edabb in do_call_core (kwdict=0x7fa5eccc8280, callargs=0x7fa5ecdd4a60, func=0x7fa5ed1c8b80, tstate=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5097
#30 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x1a5e630, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3582
#31 0x00000000004e70ca in _PyEval_EvalFrame (throwflag=0, f=0x1a5e630, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#32 _PyEval_EvalCode (tstate=<optimized out>, _co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=0x0, kwargs=0x7fa5ed00b1e0, kwcount=<optimized out>, kwstep=1, defs=0x0, defcount=<optimized out>, kwdefs=0x0, closure=0x0, name=0x7fa5ed1b5a80, qualname=0x7fa5ed1b5a80) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:4329
#33 0x00000000004f8515 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.9.13/Objects/call.c:396
#34 0x00000000004eccef in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ed00b1d0, callable=0x7fa5ed1cc3a0, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#35 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ed00b1d0, callable=0x7fa5ed1cc3a0) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:127
#36 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5077
#37 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x7fa5ed00b040, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3489
#38 0x00000000004f87f3 in _PyEval_EvalFrame (throwflag=0, f=0x7fa5ed00b040, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#39 function_code_fastcall (tstate=0x191d210, co=<optimized out>, args=<optimized out>, nargs=<optimized out>, globals=0x7fa5ed1d5500) at /usr/local/src/conda/python-3.9.13/Objects/call.c:330
#40 0x00000000004e865b in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ed1faa30, callable=0x7fa5ed190700, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#41 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ed1faa30, callable=0x7fa5ed190700) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:127
#42 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5077
#43 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x7fa5ed1fa8b0, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3506
#44 0x00000000004f87f3 in _PyEval_EvalFrame (throwflag=0, f=0x7fa5ed1fa8b0, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#45 function_code_fastcall (tstate=0x191d210, co=<optimized out>, args=<optimized out>, nargs=<optimized out>, globals=0x7fa5ed1c5f80) at /usr/local/src/conda/python-3.9.13/Objects/call.c:330
#46 0x00000000004e83a1 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ecd7f1c0, callable=0x7fa5ed1ccd30, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#47 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ecd7f1c0, callable=0x7fa5ed1ccd30) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:127
#48 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5077
#49 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x7fa5ecd7f040, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3520
#50 0x00000000004f87f3 in _PyEval_EvalFrame (throwflag=0, f=0x7fa5ecd7f040, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#51 function_code_fastcall (tstate=0x191d210, co=<optimized out>, args=<optimized out>, nargs=<optimized out>, globals=0x7fa5ed1c5f80) at /usr/local/src/conda/python-3.9.13/Objects/call.c:330
#52 0x00000000004e83a1 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x1a0ac38, callable=0x7fa5ed1ccf70, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#53 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x1a0ac38, callable=0x7fa5ed1ccf70) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:127
#54 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5077
#55 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x1a0aa80, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3520
#56 0x00000000004f87f3 in _PyEval_EvalFrame (throwflag=0, f=0x1a0aa80, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#57 function_code_fastcall (tstate=0x191d210, co=<optimized out>, args=<optimized out>, nargs=<optimized out>, globals=0x7fa5ed1c5f80) at /usr/local/src/conda/python-3.9.13/Objects/call.c:330
#58 0x00000000004e83a1 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x19ba5f8, callable=0x7fa5ed1d01f0, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#59 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x19ba5f8, callable=0x7fa5ed1d01f0) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:127
#60 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5077
#61 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x19ba460, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3520
#62 0x00000000004f87f3 in _PyEval_EvalFrame (throwflag=0, f=0x19ba460, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#63 function_code_fastcall (tstate=0x191d210, co=<optimized out>, args=<optimized out>, nargs=<optimized out>, globals=0x7fa5ed1c5f80) at /usr/local/src/conda/python-3.9.13/Objects/call.c:330
#64 0x00000000004f7e0a in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7ffe61de7150, callable=0x7fa5ed1d0280, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#65 object_vacall (tstate=0x191d210, base=0x7ffe61de7150, callable=0x7fa5ed1d0280, vargs=<optimized out>) at /usr/local/src/conda/python-3.9.13/Objects/call.c:792
#66 0x0000000000508081 in _PyObject_CallMethodIdObjArgs (obj=0x0, name=<optimized out>) at /usr/local/src/conda/python-3.9.13/Objects/call.c:882
#67 0x000000000050764e in import_find_and_load (abs_name=0x7fa5ecf37470, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/import.c:1776
#68 PyImport_ImportModuleLevelObject (name=0x7fa5ecf37470, globals=<optimized out>, locals=<optimized out>, fromlist=0x7fa5ed09e370, level=0) at /usr/local/src/conda/python-3.9.13/Python/import.c:1877
#69 0x00000000004ec132 in import_name (level=0x7fa5ed1e6910, fromlist=0x7fa5ed09e370, name=0x7fa5ecf37470, f=0x19929a0, tstate=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5198
#70 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x19929a0, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3099
#71 0x00000000004e70ca in _PyEval_EvalFrame (throwflag=0, f=0x19929a0, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#72 _PyEval_EvalCode (tstate=<optimized out>, _co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=0x0, kwargs=0x0, kwcount=<optimized out>, kwstep=2, defs=0x0, defcount=<optimized out>, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:4329
#73 0x00000000004e6d57 in _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>, kwargs=0x0, kwcount=0, kwstep=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:4361
#74 0x00000000004e6d09 in PyEval_EvalCodeEx (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kws=<optimized out>, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:4377
#75 0x0000000000594e7b in PyEval_EvalCode (co=co@entry=0x7fa5ecf34450, globals=globals@entry=0x7fa5ecf9df40, locals=locals@entry=0x7fa5ecf9df40) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:828
#76 0x0000000000599711 in builtin_exec_impl (module=<optimized out>, locals=0x7fa5ecf9df40, globals=0x7fa5ecf9df40, source=0x7fa5ecf34450) at /usr/local/src/conda/python-3.9.13/Python/bltinmodule.c:1026
#77 builtin_exec (module=<optimized out>, args=args@entry=0x7fa5ecf37b58, nargs=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/clinic/bltinmodule.c.h:396
#78 0x00000000004f8f94 in cfunction_vectorcall_FASTCALL (func=0x7fa5ed1b0d60, args=0x7fa5ecf37b58, nargsf=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.9.13/Objects/methodobject.c:430
#79 0x00000000004edabb in do_call_core (kwdict=0x7fa5ecf9df80, callargs=0x7fa5ecf37b40, func=0x7fa5ed1b0d60, tstate=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5097
#80 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x7fa5ecfea3c0, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3582
#81 0x00000000004e70ca in _PyEval_EvalFrame (throwflag=0, f=0x7fa5ecfea3c0, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#82 _PyEval_EvalCode (tstate=<optimized out>, _co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=0x0, kwargs=0x7fa5ecfea1e8, kwcount=<optimized out>, kwstep=1, defs=0x0, defcount=<optimized out>, kwdefs=0x0, closure=0x0, name=0x7fa5ed1b5a80, qualname=0x7fa5ed1b5a80) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:4329
#83 0x00000000004f8515 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.9.13/Objects/call.c:396
#84 0x00000000004eccef in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ecfea1d0, callable=0x7fa5ed1cc3a0, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#85 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ecfea1d0, callable=0x7fa5ed1cc3a0) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:127
#86 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5077
#87 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x7fa5ecfea040, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3489
#88 0x00000000004f87f3 in _PyEval_EvalFrame (throwflag=0, f=0x7fa5ecfea040, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#89 function_code_fastcall (tstate=0x191d210, co=<optimized out>, args=<optimized out>, nargs=<optimized out>, globals=0x7fa5ed1d5500) at /usr/local/src/conda/python-3.9.13/Objects/call.c:330
#90 0x00000000004e865b in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ecfe91c0, callable=0x7fa5ed18d550, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#91 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ecfe91c0, callable=0x7fa5ed18d550) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:127
#92 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5077
#93 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x7fa5ecfe9040, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3506
#94 0x00000000004f87f3 in _PyEval_EvalFrame (throwflag=0, f=0x7fa5ecfe9040, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#95 function_code_fastcall (tstate=0x191d210, co=<optimized out>, args=<optimized out>, nargs=<optimized out>, globals=0x7fa5ed1c5f80) at /usr/local/src/conda/python-3.9.13/Objects/call.c:330
#96 0x00000000004e83a1 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x19d0f48, callable=0x7fa5ed1ccf70, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#97 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x19d0f48, callable=0x7fa5ed1ccf70) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:127
#98 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5077
#99 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x19d0d90, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3520
#100 0x00000000004f87f3 in _PyEval_EvalFrame (throwflag=0, f=0x19d0d90, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#101 function_code_fastcall (tstate=0x191d210, co=<optimized out>, args=<optimized out>, nargs=<optimized out>, globals=0x7fa5ed1c5f80) at /usr/local/src/conda/python-3.9.13/Objects/call.c:330
#102 0x00000000004e83a1 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ed00a958, callable=0x7fa5ed1d01f0, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#103 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7fa5ed00a958, callable=0x7fa5ed1d01f0) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:127
#104 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5077
#105 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x7fa5ed00a7c0, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3520
#106 0x00000000004f87f3 in _PyEval_EvalFrame (throwflag=0, f=0x7fa5ed00a7c0, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#107 function_code_fastcall (tstate=0x191d210, co=<optimized out>, args=<optimized out>, nargs=<optimized out>, globals=0x7fa5ed1c5f80) at /usr/local/src/conda/python-3.9.13/Objects/call.c:330
#108 0x00000000004f7e0a in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7ffe61de8090, callable=0x7fa5ed1d0280, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/cpython/abstract.h:118
#109 object_vacall (tstate=0x191d210, base=0x7ffe61de8090, callable=0x7fa5ed1d0280, vargs=<optimized out>) at /usr/local/src/conda/python-3.9.13/Objects/call.c:792
#110 0x0000000000508081 in _PyObject_CallMethodIdObjArgs (obj=0x0, name=<optimized out>) at /usr/local/src/conda/python-3.9.13/Objects/call.c:882
#111 0x000000000050764e in import_find_and_load (abs_name=0x7fa5ed0e4870, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Python/import.c:1776
#112 PyImport_ImportModuleLevelObject (name=0x7fa5ed0e4870, globals=<optimized out>, locals=<optimized out>, fromlist=0x73cbc0 <_Py_NoneStruct>, level=0) at /usr/local/src/conda/python-3.9.13/Python/import.c:1877
#113 0x00000000004ec132 in import_name (level=0x7fa5ed1e6910, fromlist=0x73cbc0 <_Py_NoneStruct>, name=0x7fa5ed0e4870, f=0x1978300, tstate=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:5198
#114 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=0x1978300, throwflag=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:3099
#115 0x00000000004e70ca in _PyEval_EvalFrame (throwflag=0, f=0x1978300, tstate=0x191d210) at /usr/local/src/conda/python-3.9.13/Include/internal/pycore_ceval.h:40
#116 _PyEval_EvalCode (tstate=<optimized out>, _co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=0x0, kwargs=0x0, kwcount=<optimized out>, kwstep=2, defs=0x0, defcount=<optimized out>, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:4329
#117 0x00000000004e6d57 in _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>, kwargs=0x0, kwcount=0, kwstep=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:4361
#118 0x00000000004e6d09 in PyEval_EvalCodeEx (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kws=<optimized out>, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:4377
#119 0x0000000000594e7b in PyEval_EvalCode (co=co@entry=0x7fa5ed15a870, globals=globals@entry=0x7fa5ed152740, locals=locals@entry=0x7fa5ed152740) at /usr/local/src/conda/python-3.9.13/Python/ceval.c:828
#120 0x00000000005c2307 in run_eval_code_obj (tstate=0x191d210, co=0x7fa5ed15a870, globals=0x7fa5ed152740, locals=0x7fa5ed152740) at /usr/local/src/conda/python-3.9.13/Python/pythonrun.c:1221
#121 0x00000000005be270 in run_mod (mod=<optimized out>, filename=<optimized out>, globals=0x7fa5ed152740, locals=0x7fa5ed152740, flags=<optimized out>, arena=<optimized out>) at /usr/local/src/conda/python-3.9.13/Python/pythonrun.c:1242
#122 0x00000000004563ed in pyrun_file (fp=0x1919470, filename=0x7fa5ed11d8f0, start=<optimized out>, globals=0x7fa5ed152740, locals=0x7fa5ed152740, closeit=1, flags=0x7ffe61de86f8) at /usr/local/src/conda/python-3.9.13/Python/pythonrun.c:1140
#123 0x00000000005b8062 in pyrun_simple_file (flags=0x7ffe61de86f8, closeit=1, filename=0x7fa5ed11d8f0, fp=0x1919470) at /usr/local/src/conda/python-3.9.13/Python/pythonrun.c:450
#124 PyRun_SimpleFileExFlags (fp=0x1919470, filename=<optimized out>, closeit=1, flags=0x7ffe61de86f8) at /usr/local/src/conda/python-3.9.13/Python/pythonrun.c:483
#125 0x00000000005b55ce in pymain_run_file (cf=0x7ffe61de86f8, config=0x191bbf0) at /usr/local/src/conda/python-3.9.13/Modules/main.c:379
#126 pymain_run_python (exitcode=0x7ffe61de86f0) at /usr/local/src/conda/python-3.9.13/Modules/main.c:604
#127 Py_RunMain () at /usr/local/src/conda/python-3.9.13/Modules/main.c:683
#128 0x0000000000588ff9 in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at /usr/local/src/conda/python-3.9.13/Modules/main.c:1129
#129 0x00007fa5ed2abd90 in __libc_start_call_main (main=main@entry=0x588fb0 <main>, argc=argc@entry=2, argv=argv@entry=0x7ffe61de8928) at ../sysdeps/nptl/libc_start_call_main.h:58
#130 0x00007fa5ed2abe40 in __libc_start_main_impl (main=0x588fb0 <main>, argc=2, argv=0x7ffe61de8928, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe61de8918) at ../csu/libc-start.c:392
#131 0x0000000000588eae in _start ()
此處不關心中間的調用過程,只看最後一個節點:c10::ArrayRef<c10::detail::infer_schema::ArgumentDef>::ArrayRef<1ul>
,其中的1ul
就是C++中的unsigned long long類型的1。
所以c10::ArrayRef<c10::detail::infer_schema::ArgumentDef>::ArrayRef<1ul>
就是c10::ArrayRef<int64_t>
,也就是at::IntArrayRef
。
這驗證了torch.empty(3, 4)
這段Python代碼底層調用的確實是at::IntArrayRef
。