MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / flatten_to_matrix_shape

Function flatten_to_matrix_shape

src/framework/modules/linear_module.cpp:29–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27};
28
29core::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
37void validate_weight_shape(const LinearConfig & config, const LinearWeights & weights) {
38 core::validate_shape(

Callers 1

buildMethod · 0.70

Calls 2

last_dimMethod · 0.80
prefix_elementsMethod · 0.80

Tested by

no test coverage detected