2 #include <ATen/core/interned_strings.h> 3 #include <c10/util/intrusive_ptr.h> 4 #include <torch/csrc/WindowsTorchApiMacro.h> 25 c10::raw::intrusive_ptr::incref(
this);
34 name_ = Symbol::scope(
"");
38 parent_ = std::move(parent);
44 throw std::runtime_error(
"Cannot get parent from Scope with no parent");
51 bool isBlank()
const {
52 static const Symbol blank = Symbol::scope(
"");
53 return isRoot() && name() == blank;
64 std::string namesFromRoot(
const std::string& separator =
"/")
const;
intrusive_ptr<T> is an alternative to shared_ptr<T> that has better performance because it does the r...
static intrusive_ptr reclaim(TTarget *owning_ptr)
Takes an owning pointer to TTarget* and creates an intrusive_ptr that takes over ownership.