sxjscience commented on a change in pull request #19387:
URL: https://github.com/apache/incubator-mxnet/pull/19387#discussion_r508806796
##########
File path: src/operator/contrib/transformer-inl.h
##########
@@ -61,6 +61,229 @@ static void DivSqrtDimForward_(const nnvm::NodeAttrs& attrs,
});
}
+
+
+struct SldWinAttenParam : public dmlc::Parameter<SldWinAttenParam> {
+ int w;
+ bool symmetric;
+ DMLC_DECLARE_PARAMETER(SldWinAttenParam) {
+ DMLC_DECLARE_FIELD(w)
+ .describe("The one-sided window length");
+ DMLC_DECLARE_FIELD(symmetric)
+ .describe("Whether to use causal attention");
Review comment:
Either `symmetric` or `causal` looks good. If we keep it as `symmetric`,
we may mention that `when symmetric is False, it will use the one-sided causal
attention`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]