Caffe2 - C++ API
A deep learning, cross platform ML framework
attributes.cpp
1 #include <torch/csrc/jit/attributes.h>
2 #include <torch/csrc/jit/ir.h>
3 
4 namespace torch {
5 namespace jit {
6 
7 AttributeValue::Ptr GraphAttr::clone() const {
8  return Ptr(new GraphAttr(name, value_->copy()));
9 }
10 
11 std::unique_ptr<AttributeValue> GraphsAttr::clone() const {
12  std::vector<std::shared_ptr<Graph>> copy(value_.size());
13  for (size_t i = 0; i < value_.size(); ++i) {
14  copy[i] = value_.at(i)->copy();
15  }
16  return Ptr(new GraphsAttr(name, std::move(copy)));
17 }
18 
19 
20 } // namespace jit
21 } // namespace torch
Definition: jit_type.h:17