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

Method ToString

tensorflow/compiler/xla/service/shaped_buffer.cc:90–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90string ShapedBuffer::ToString() const {
91 string s = absl::StrCat(
92 "ShapedBuffer(", platform_->Name(), ":", device_ordinal(),
93 "), on-host shape=" + ShapeUtil::HumanStringWithLayout(on_host_shape()),
94 ", on-device shape=" +
95 ShapeUtil::HumanStringWithLayout(on_device_shape()),
96 ":\n");
97 ShapeUtil::ForEachSubshape(
98 on_device_shape(),
99 [this, &s](const Shape& subshape, const ShapeIndex& index) {
100 string shape_str;
101 if (subshape.IsTuple()) {
102 shape_str = "tuple";
103 } else {
104 shape_str = ShapeUtil::HumanStringWithLayout(subshape);
105 }
106 const se::DeviceMemoryBase& memory = buffer(index);
107 absl::StrAppendFormat(&s, " %s%p (%d bytes) : %s\n",
108 string(index.size() * 2, ' '), memory.opaque(),
109 memory.size(), shape_str);
110 });
111 return s;
112}
113
114std::ostream& operator<<(std::ostream& out, const ShapedBuffer& buffer) {
115 out << buffer.ToString();

Callers 1

shaped_buffer.ccFile · 0.45

Calls 7

device_ordinalFunction · 0.85
bufferFunction · 0.85
opaqueMethod · 0.80
StrCatFunction · 0.50
NameMethod · 0.45
IsTupleMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected