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

Method CreateFromShape

tensorflow/compiler/xla/literal.cc:189–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189Literal LiteralBase::CreateFromShape(const Shape& shape) {
190 Literal literal(shape);
191 literal.root_piece_->ForEachMutableSubpiece(
192 [&](const ShapeIndex& index, Piece* piece) {
193 if (piece->subshape().IsArray()) {
194 memset(piece->untyped_data(), 0, piece->size_bytes());
195 }
196 });
197 return literal;
198}
199
200template <typename NativeT>
201Status MutableLiteralBase::CopySliceFromInternal(

Callers

nothing calls this directly

Calls 4

untyped_dataMethod · 0.80
IsArrayMethod · 0.45
size_bytesMethod · 0.45

Tested by

no test coverage detected