Closed mingmingtasd closed 2 years ago
As feedback of WebML WG Teleconference – 18 Nov 2021, the static attribute is preferred, e.g. @wchao1115 mentioned
+1 on prefer static, dynamism breaks accelerator's pipelining
Another reference is TensorFlow.js, according to tf.pad, the paddings
is also an array.
With that, I propose to change the padding
input of WebNN's pad to an array (sequence in WebIDL).
@mingmingtasd , I am not sure whether it aligns with your proposal. What do you mean by using "tensor type"?
As feedback of WebML WG Teleconference – 18 Nov 2021, the static attribute is preferred, e.g. @wchao1115 mentioned
+1 on prefer static, dynamism breaks accelerator's pipelining
Another reference is TensorFlow.js, according to tf.pad, the
paddings
is also an array.With that, I propose to change the
padding
input of WebNN's pad to an array (sequence in WebIDL).@mingmingtasd , I am not sure whether it aligns with your proposal. What do you mean by using "tensor type"?
Yes, that aligns with what I mean: using array. Thanks! @huningxin
@mingmingtasd , as @wchao1115 's feedback, DirectML is supporting dynamic padding data. And NNAPI ANEURALNETWORKS_PAD_V2 also supports padding data as an operand. So it looks like the current pad op definition of WebNN is more future-proof.
With that, I would withdraw my proposal and keep the current version. WDYT?
@mingmingtasd , as @wchao1115 's feedback, DirectML is supporting dynamic padding data. And NNAPI ANEURALNETWORKS_PAD_V2 also supports padding data as an operand. So it looks like the current pad op definition of WebNN is more future-proof.
With that, I would withdraw my proposal and keep the current version. WDYT?
Yes, I agree, thanks for your explaination. @huningxin
Thanks for the feedback @mingmingtasd ! I'll close PR #233 and this one.
The pad in the spec uses the
MLOperand padding
as its sencond input. But I find that the pad in DML and in IE, padding was defined with a tensor type. I think it's better to use tensor type to avoid the gap between spec and implementation.