pytorch/torch/csrc/jit/ir/attributes.cpp
Nikita Shulga 8f1c3c68d3 [BE] Use nested namespaces in .cpp/.cu files (#92100)
As we live in C++17 world

This is a functional no-op, just
- `s/namespace at { namespace native {/namespace at::native {/`
- `s/namespace torch { namespace jit {/namespace torch::jit {/`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/92100
Approved by: https://github.com/izaitsevfb
2023-01-13 16:32:34 +00:00

20 lines
524 B
C++

#include <c10/util/irange.h>
#include <torch/csrc/jit/ir/attributes.h>
#include <torch/csrc/jit/ir/ir.h>
namespace torch::jit {
AttributeValue::Ptr GraphAttr::clone() const {
return Ptr(new GraphAttr(name, value_->copy()));
}
std::unique_ptr<AttributeValue> GraphsAttr::clone() const {
std::vector<std::shared_ptr<Graph>> copy(value_.size());
for (const auto i : c10::irange(value_.size())) {
copy[i] = value_.at(i)->copy();
}
return Ptr(new GraphsAttr(name, std::move(copy)));
}
} // namespace torch::jit