Skip to content

Commit

Permalink
enable cpu support
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyi9801 committed Aug 29, 2024
1 parent cdfb34e commit 58b713e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/web/docs/webnn-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ operators and the supported opset domain/versions in **WebNN EP** by ONNX Runtim
| LessOrEqual | ai.onnx(12-15, 16+) | lesserOrEqual ||| |
| Log | ai.onnx(7-12, 13+) | log ||| |
| LpPool | ai.onnx(7-10, 11-17, 18+) | l2Pool2d ||| Only supports 4-D input, 2-D 'kernel_shape', 'p' value is 2 |
| LSTM | ai.onnx(7-13, 14+) | lstm | || Only supports 'layout' == 0, 'input_forget' == 0. 'clip' is not supported. The activation functions in 'activations' must be one of 'Relu', 'Tanh', 'Sigmoid'. Forward and backward activations must be the same if bidirectional. 'sequence_lens' if present should be constant with values equal to the first dimension length of input 'X' |
| LSTM | ai.onnx(7-13, 14+) | lstm | || Only supports 'layout' == 0, 'input_forget' == 0. 'clip' is not supported. The activation functions in 'activations' must be one of 'Relu', 'Tanh', 'Sigmoid'. Forward and backward activations must be the same if bidirectional. 'sequence_lens' if present should be constant with values equal to the first dimension length of input 'X' |
| MatMul | ai.onnx(7-8, 9-12, 13+) | matmul ||| |
| Max | ai.onnx(7, 8-11, 12, 13+) | max ||| |
| MaxPool | ai.onnx(7, 8-9, 10, 11, 12+) | maxPool2d ||| Only supports 4-D input, 2-D 'kernel_shape', 'storage_order' != 1, one output |
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webnn/builders/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static const InlinedHashMap<std::string, WebnnOpInfo> op_map = {
{"LessOrEqual", {"lesserOrEqual", true}},
{"Log", {"log", true}},
{"LpPool", {"l2Pool2d", false}},
{"LSTM", {"lstm", false}},
{"LSTM", {"lstm", true}},
{"MatMul", {"matmul", true}},
{"MatMulInteger", {"matmulInteger", false}},
{"Max", {"max", true}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ bool LstmOpBuilder::IsOpSupportedImpl(const InitializedTensorSet& initializers,
LOGS(logger, ERROR) << "Cannot read sequence lens tensor";
return false;
}
if (!std::all_of(sequence_lens.begin(), sequence_lens.end(),
[steps](int32_t lens) -> bool { return steps == lens; })) {
if (std::any_of(sequence_lens.begin(), sequence_lens.end(),
[steps](int32_t lens) -> bool { return steps != lens; })) {
LOGS(logger, ERROR) << "LSTM: every sequence length must be equal to input shape[0]";
return false;
}
Expand Down

0 comments on commit 58b713e

Please sign in to comment.