Skip to content

Commit

Permalink
Merge pull request #278 from vbenni/mobilenetv2_main
Browse files Browse the repository at this point in the history
 (nnapi)  Added support for zero input dimension for Gemm op
  • Loading branch information
fujunwei authored Jun 27, 2022
2 parents d4318ce + 12dcb4e commit 1277e11
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/webnn/native/nnapi/GraphNnapi.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,14 @@ namespace webnn::native::nnapi {
const void* buffer = nullptr) {
std::shared_ptr<NodeInfo> node = std::make_shared<NodeInfo>();
node->type = desc->type;
for (size_t i = 0; i < desc->dimensionsCount; i++) {
node->dimensions.push_back(static_cast<uint32_t>(desc->dimensions[i]));
if (desc->dimensionsCount == 0) {
node->dimensions.push_back(static_cast<uint32_t>(1));
} else {
for (size_t i = 0; i < desc->dimensionsCount; i++) {
node->dimensions.push_back(static_cast<uint32_t>(desc->dimensions[i]));
}
}

MaybeError error;
if (buffer) {
error = mNnapiMgr->CreateOperandAndSetMemory(name, node, buffer);
Expand Down

0 comments on commit 1277e11

Please sign in to comment.