-
Notifications
You must be signed in to change notification settings - Fork 854
fix: Support to Bool input for Onnx models #2130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Jason Wang <[email protected]>
|
Hey @memoryz 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
|
To generate a test model: from onnx import TensorProto
from onnx.helper import (make_node, make_graph, make_model_gen_version, make_opsetid, make_tensor_value_info)
from onnx.checker import check_model
A = make_tensor_value_info('A', TensorProto.BOOL, [None])
B = make_tensor_value_info('B', TensorProto.BOOL, [None])
Y = make_tensor_value_info('Y', TensorProto.BOOL, [None])
node = make_node('And', ['A', 'B'], ['Y'])
graph = make_graph([node], 'And', [A, B], [Y])
onnx_model = make_model_gen_version(graph, opset_imports=[make_opsetid("", 7)])
check_model(onnx_model)
with open("GH1996.onnx", "wb") as f:
f.write(onnx_model.SerializeToString())To test: import com.microsoft.azure.synapse.ml.onnx.ONNXModel
val df = Seq((true, true), (true, false), (false, false)).toDF("i1", "i2")
val model: ONNXModel = new ONNXModel()
.setModelLocation("wasbs://[email protected]/ONNXModels/GH1996.onnx")
.setFeedDict(Map("A" -> "i1", "B" -> "i2"))
.setFetchDict(Map("Output" -> "Y"))
display(model.transform(df))Expected output:
|
|
/azp run |
Supported commands
See additional documentation. |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report
@@ Coverage Diff @@
## master #2130 +/- ##
==========================================
- Coverage 85.84% 85.76% -0.08%
==========================================
Files 312 312
Lines 16470 16477 +7
Branches 1458 1460 +2
==========================================
- Hits 14138 14132 -6
- Misses 2332 2345 +13
|
Related Issues/PRs
#1996
What changes are proposed in this pull request?
Adding support for Boolean input in ONNX model transform
How is this patch tested?
Does this PR change any dependencies?
Does this PR add a new feature? If so, have you added samples on website?
website/docs/documentationfolder.Make sure you choose the correct class
estimators/transformersand namespace.DocTablepoints to correct API link.yarn run startto make sure the website renders correctly.<!--pytest-codeblocks:cont-->before each python code blocks to enable auto-tests for python samples.WebsiteSamplesTestsjob pass in the pipeline.