-
Notifications
You must be signed in to change notification settings - Fork 48
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
Make the starts
and sizes
definitions of slice
op consistent and simplified
#369
Comments
Thanks for creating the issue and sharing the xnn_define_static_slice and MLCSliceLayer information. I feel comfortable removing the
It might be useful to have an options object, if we want to extend it later with window
Though, just appending another
Alternately we could do the hybrid option like pad and pass the first two parameters and an options parameter later. So there are at least 3 options here, but I'm not clear what factors in WebNN determine whether parameters should be stuffed inside an options object vs passed directly? Is it mainly driven by optionality of the parameter? I do value consistency between functions, and this 3rd option is consistent with pad.
|
1. Change `starts` and `sizes` parameters to be sequence of unsigned long. 2. Remove `MLSliceOptions.axes`. Fix webmachinelearning#369
Thanks @fdwr for sharing the insightful thoughts. Very helpful! Based on the option 3, I made a PR #376 that simplifies the current Regarding to |
1. Change `starts` and `sizes` parameters to be sequence of unsigned long. 2. Remove `MLSliceOptions.axes`. Fix webmachinelearning#369
Thanks @fdwr for pointing out the inconsistency of
starts
andsizes
definitions ofslice
op when revisiting the PR #359 (comment), where Dwayne mentioned:In a followed comment, Dwayne also pointed out that
From my point of view, using unsigned integer for
starts
andsizes
makes sense. It not only would help ensure the consistency across the spec but also would simplify the implementation. The native ML APIs, such as DirectML'sDML_SLICE1_OPERATOR_DESC
and XNNPACK'sxnn_define_static_slice
, usually use unsigned integer starts/offsets and sizes.Another simplification idea is whether the
MLSliceOptions
should be removed.MLSliceOptions.axes
is used to indicate the dimensions of the input shape to which starts and sizes apply. However, native ML APIs, e.g. DirectML'sDML_SLICE1_OPERATOR_DESC
, XNNPACK'sxnn_define_static_slice
and MLCompute'sMLCSliceLayer
, usually expect thestarts
andoffsets
for all dimensions to be provided.With that, a possible simplified
slice
op definition would beThoughts?
The text was updated successfully, but these errors were encountered: