Skip to content
fn

enable_tensor_autograd_gc

void enable_tensor_autograd_gc(int * heap_type)

Enable CPython cyclic garbage collection (Py_TPFLAGS_HAVE_GC, tp_traverse, tp_clear) on pybind11 heap types that can participate in reference cycles through the C++ autograd graph.