| 27 | }; |
| 28 | |
| 29 | core::TensorShape flatten_to_matrix_shape(const core::TensorShape & shape) { |
| 30 | if (shape.rank == 1) { |
| 31 | return core::TensorShape::from_dims({1, shape.last_dim()}); |
| 32 | } |
| 33 | |
| 34 | return core::TensorShape::from_dims({shape.prefix_elements(), shape.last_dim()}); |
| 35 | } |
| 36 | |
| 37 | void validate_weight_shape(const LinearConfig & config, const LinearWeights & weights) { |
| 38 | core::validate_shape( |
no test coverage detected