1 #include <c10/util/irange.h> 2 #include <torch/csrc/jit/ir/attributes.h> 3 #include <torch/csrc/jit/ir/ir.h> 4 5 namespace torch::jit { 6 clone() const7AttributeValue::Ptr GraphAttr::clone() const { 8 return Ptr(new GraphAttr(name, value_->copy())); 9 } 10 clone() const11std::unique_ptr<AttributeValue> GraphsAttr::clone() const { 12 std::vector<std::shared_ptr<Graph>> copy(value_.size()); 13 for (const auto i : c10::irange(value_.size())) { 14 copy[i] = value_.at(i)->copy(); 15 } 16 return Ptr(new GraphsAttr(name, std::move(copy))); 17 } 18 19 } // namespace torch::jit 20