"We are in the process of adding our fused kernels to Pytorch core, "+
input(torch.cuda.FloatTensor or torch.cuda.HalfTensor): input tensor corresponding to **v** in the paper. ``input`` should be contiguous.
"so Pytorch's built-in weightnorm will use them transparently.")
g(torch.cuda.FloatTensor or torch.cuda.HalfTensor): input tensor corresponding to **g** in the paper. ``g`` should be the same type as ``input``.
dim(int, optional, default=0): Dimension across which to perform weightnorm. Currently, only the first or last dimension of the input tensor is supported.
Returns:
Output tensor corresponding to **w** in the paper. Output type and precision will match
"We are in the process of adding our fused kernels to Pytorch core, "+
grad_output(torch.cuda.FloatTensor or torch.cuda.HalfTensor): Gradient of loss with respect to output **w**. ``grad_output`` should be contiguous for performance.
"so Pytorch's built-in weightnorm will use them transparently.")
Returns:
Gradient of loss with respect to ``input`` and ``g``. The precision of these gradients will match the precision of ``grad_input``.
"""
check_contig_cuda((grad_output),("grad_output"))
savedInput,savedg=ctx.saved_tensors
savedNorms=ctx.norms
# We expect that these .contiguous() calls will be no-ops. They're present for safety.