| 187 | } |
| 188 | |
| 189 | Literal 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 | |
| 200 | template <typename NativeT> |
| 201 | Status MutableLiteralBase::CopySliceFromInternal( |
nothing calls this directly
no test coverage detected