-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements option zipmap for MultiOutputClassifier (#775)
* Implements option zipmap for MultiOutputClassifier Signed-off-by: adam444555 <a473489548@gmail.com>
- Loading branch information
1 parent
9d379ed
commit 77a6a2f
Showing
14 changed files
with
423 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from ..proto import onnx_proto | ||
from ..common._registration import register_converter | ||
from ..common._topology import Scope, Operator | ||
from ..common._container import ModelComponentContainer | ||
|
||
|
||
def convert_sklearn_sequence_at(scope: Scope, operator: Operator, | ||
container: ModelComponentContainer): | ||
i_index = operator.index | ||
index_name = scope.get_unique_variable_name("seq_at%d" % i_index) | ||
container.add_initializer( | ||
index_name, onnx_proto.TensorProto.INT64, [], [i_index]) | ||
container.add_node( | ||
'SequenceAt', [operator.inputs[0].full_name, index_name], | ||
operator.outputs[0].full_name, | ||
name=scope.get_unique_operator_name('SequenceAt%d' % i_index)) | ||
|
||
|
||
def convert_sklearn_sequence_construct(scope: Scope, operator: Operator, | ||
container: ModelComponentContainer): | ||
container.add_node( | ||
'SequenceConstruct', [i.full_name for i in operator.inputs], | ||
operator.outputs[0].full_name, | ||
name=scope.get_unique_operator_name('SequenceConstruct')) | ||
|
||
|
||
register_converter('SklearnSequenceAt', convert_sklearn_sequence_at) | ||
register_converter( | ||
'SklearnSequenceConstruct', convert_sklearn_sequence_construct) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from ..common._registration import register_shape_calculator | ||
|
||
|
||
def calculate_sklearn_sequence_at(operator): | ||
pass | ||
|
||
|
||
def calculate_sklearn_sequence_construct(operator): | ||
pass | ||
|
||
|
||
register_shape_calculator('SklearnSequenceAt', calculate_sklearn_sequence_at) | ||
register_shape_calculator( | ||
'SklearnSequenceConstruct', calculate_sklearn_sequence_construct) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.