MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BufferAssignmentToString

Function BufferAssignmentToString

tensorflow/compiler/xla/tools/driver.cc:213–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211};
212
213std::string BufferAssignmentToString(const BufferAssignment& assignment) {
214 std::ostringstream out;
215 for (const auto& p : assignment.param_to_alloc_idx) {
216 int param_idx = p.first;
217 int allocation_idx = p.second;
218 out << "Param: " << param_idx << " (allocation " << allocation_idx << "): ";
219 auto p2 = assignment.buffers_shape.find(allocation_idx);
220 Check(p2 != assignment.buffers_shape.end(),
221 "Shape not found for parameter: " + std::to_string(param_idx));
222 out << TupleShapeToString(p2->second)
223 << ", size = " << assignment.buffers_size[allocation_idx] << "\n";
224 }
225 return out.str();
226}
227
228// RAII table for the given assignment: mapping from a allocation idx to the
229// actual allocation.

Callers 1

mainFunction · 0.85

Calls 5

to_stringFunction · 0.85
TupleShapeToStringFunction · 0.85
CheckFunction · 0.70
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected