Sets the layout of the given ShapeProto to the default.
| 1410 | |
| 1411 | // Sets the layout of the given ShapeProto to the default. |
| 1412 | void SetDefaultLayoutOnProto(ShapeProto* shape_proto) { |
| 1413 | CHECK(ShapeUtil::IsArrayPrimitiveType(shape_proto->element_type())); |
| 1414 | shape_proto->mutable_layout()->set_format(DENSE); |
| 1415 | auto* minor_to_major = |
| 1416 | shape_proto->mutable_layout()->mutable_minor_to_major(); |
| 1417 | minor_to_major->Resize(shape_proto->dimensions_size(), 0); |
| 1418 | const int64 size = minor_to_major->size(); |
| 1419 | for (int64 i = 0; i < size; ++i) { |
| 1420 | minor_to_major->Set(i, size - 1 - i); |
| 1421 | } |
| 1422 | } |
| 1423 | |
| 1424 | TEST_F(LiteralUtilTest, CopyFromProto_Bool) { |
| 1425 | LiteralProto p; |
no test coverage detected