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

Function MakeArrayDims

tensorflow/lite/toco/tooling_util.cc:1458–1476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1456}
1457
1458void MakeArrayDims(int num_dims, int batch, int height, int width, int depth,
1459 std::vector<int>* out_dims) {
1460 CHECK(out_dims->empty());
1461 if (num_dims == 0) {
1462 return;
1463 } else if (num_dims == 1) {
1464 CHECK_EQ(batch, 1);
1465 *out_dims = {depth};
1466 } else if (num_dims == 2) {
1467 *out_dims = {batch, depth};
1468 } else if (num_dims == 3) {
1469 CHECK_EQ(batch, 1);
1470 *out_dims = {height, width, depth};
1471 } else if (num_dims == 4) {
1472 *out_dims = {batch, height, width, depth};
1473 } else {
1474 LOG(FATAL) << "Should not get here: " << num_dims;
1475 }
1476}
1477
1478void CreateOrCheckRnnStateArray(const string& name, int size,
1479 int state_num_dims, Model* model) {

Callers 1

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected