38 assert(input_num_dims <= 8);
39 bool should_squeeze[8] = {
false};
40 int num_squeezed_dims = 0;
41 if (num_squeeze_dims == 0)
43 for (
int idx = 0; idx < input_num_dims; ++idx)
45 if (
input()->shape().dim(idx) == 1)
47 should_squeeze[idx] =
true;
54 for (
int idx = 0; idx < num_squeeze_dims; ++idx)
58 assert(current >= 0 && current < input_num_dims &&
input()->shape().dim(current) == 1);
59 if (!should_squeeze[current])
61 should_squeeze[current] =
true;
65 for (
int in_idx = 0, out_idx = 0; in_idx < input_num_dims; ++in_idx)
67 if (!should_squeeze[in_idx])