| 137 | } |
| 138 | |
| 139 | ScopedAllocatorContainer* ScopedAllocatorMgr::GetContainer(int64 step_id) { |
| 140 | VLOG(2) << "GetContainer " << step_id << " on " << device_name(); |
| 141 | ScopedAllocatorContainer* sac = nullptr; |
| 142 | mutex_lock l(mu_); |
| 143 | auto it = per_step_map_.find(step_id); |
| 144 | if (it == per_step_map_.end()) { |
| 145 | sac = new ScopedAllocatorContainer(this, step_id); |
| 146 | per_step_map_[step_id] = sac; |
| 147 | } else { |
| 148 | sac = it->second; |
| 149 | } |
| 150 | return sac; |
| 151 | } |
| 152 | |
| 153 | Status ScopedAllocatorMgr::AddScopedAllocator( |
| 154 | const Tensor& backing_tensor, int64 step_id, int32 scope_id, |