MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / checkArrayShape

Function checkArrayShape

plugins/wasi_nn/MLX/model/gemma3/vision.cpp:58–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58bool checkArrayShape(const mx::array &Arr) {
59 auto Shape = Arr.shape();
60 if (Shape.size() != 4)
61 return false;
62 int OutChannels = Shape[0];
63 int KH = Shape[1];
64 int KW = Shape[2];
65 return (OutChannels >= KH) && (OutChannels >= KW) && (KH == KW);
66}
67
68VisionAttention::VisionAttention(int Dims, int NumHeads,
69 std::optional<int> QueryInputDims,

Callers 1

sanitizeMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected