61 LUCI_ASSERT(weights_shape.rank() == 2,
"Weights of FullyConnected should be 2");
62 LUCI_ASSERT(weights_shape.dim(0).known() && weights_shape.dim(1).known(),
63 "Weights of FullyConnected should be known")
89 out_shape.
rank(input_shape.rank());
90 for (uint32_t i = 0; i < input_shape.rank(); ++i)
91 out_shape.
dim(i) = input_shape.dim(i);
92 out_shape.
dim(out_shape.
rank() - 1) = weights_shape.dim(0);
96 bool is_dynamic_shape =
false;
98 for (uint32_t i = 0; i < input_shape.rank() - 1; i++)
100 if (not input_shape.dim(i).known())
102 is_dynamic_shape =
true;
107 uint32_t batch_size = 1;
109 for (uint32_t i = 0; i < input_shape.rank() - 1; i++)
111 batch_size *= input_shape.dim(i).
value();
115 if (is_dynamic_shape)
118 out_shape.
dim(0) = batch_size;
119 out_shape.
dim(1) = weights_shape.dim(0);