def __call__(self, weight: Optional[mx.nd.NDArray] = None, scale: Optional[mx.nd.NDArray] = None) -> mx.sym.Symbol:
        """
        Normalize each hidden dimension and scale afterwards

        :return: A weight normalized weight tensor.
        """
        if weight is None and scale is None:
            return mx.sym.broadcast_mul(lhs=mx.sym.L2Normalization(self.weight, mode='instance'),
                                        rhs=self.scale, name="%swn_scale" % self.prefix)
        else:
            assert isinstance(weight, mx.nd.NDArray)
            assert isinstance(scale, mx.nd.NDArray)
            return mx.nd.broadcast_mul(lhs=mx.nd.L2Normalization(weight, mode='instance'), rhs=scale)
def __call__ ( self , weight : Optional [ mx . nd . NDArray ] = None , scale : Optional [ mx . nd . NDArray ] = None ) -> mx . sym . Symbol : if weight is None and scale is None : return mx . sym . broadcast_mul ( lhs = mx . sym . L2Normalization ( self . weight , mode = 'instance' ) , rhs = self . scale , name = "%swn_scale" % self . prefix ) else : assert isinstance ( weight , mx . nd . NDArray ) assert isinstance ( scale , mx . nd . NDArray ) return mx . nd . broadcast_mul ( lhs = mx . nd . L2Normalization ( weight , mode = 'instance' ) , rhs = scale )
Normalize each hidden dimension and scale afterwards

        :return: A weight normalized weight tensor.