MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / Record

Method Record

oneflow/core/framework/tensor_name_scope.cpp:46–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void TensorNameScope::Record(const Tensor* tensor, const std::string& name) {
47 uint64_t key = reinterpret_cast<uint64_t>(tensor);
48 auto* tensor_names = [&]() {
49 if (tensor->is_lazy()) { return &lazy_tensor_names_; }
50 return &eager_tensor_names_;
51 }();
52 std::lock_guard<std::mutex> lock(mutex_);
53 // We assume that the name of the tensor will be update more than once.
54 (*tensor_names)[key] = name;
55}
56
57void TensorNameScope::Record(const std::shared_ptr<Tensor>& tensor, const std::string& name) {
58 Record(tensor.get(), name);

Calls 2

is_lazyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected