-
Notifications
You must be signed in to change notification settings - Fork 127
operator: InstanceNormalization operator for wasm and cpu backends #82
Conversation
Merge remote master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is generally good to go.
} | ||
|
||
// overriding the checkInputTypes() in the base class because Wasm backend has special type limitations | ||
checkInputTypes(inputs: Tensor[]): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we apply the special type check only? I think typescript keyword super
can help to call parent class method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now checkInputTypes()
in the base class also does some other validation other than type validation and hence we need to copy over that snippet of code as well in this method as this method overrides completely the base method. We can make a change later to make it in such a way that only type check is overridden and other kinds of input validation is still common across base and derived classes (hence prevent code duplication). But there are one or two more ops that require this kind of change. So I prefer to do this separately in another change.
Let's hold off on this change for a little bit - I see that onnxruntime implemented the IN op using Eigen and hence I would like to be consistent with that as much as possible. Even though I see no scope for optimization and I feel the current implementation is good enough, I would like to understand if we can directly use onnxruntime code. I will try this tomorrow if possible. |
Merging this change - if need be we will re-visit later and use Eigen based implementation if perf is an issue for a real model. |
This PR is to support InstanceNormalization operator for wasm and cpu backends