How Pytorch do row normalization for each matrix in a 3D Tensor(Variable)?
If I have a 3D Tensor (Variable) with size [a,b,c].
consider it as a b*c matrix, and I hope that all these a matrix got row normalized. 

You can use the normalize function.

import torch.nn.functional as f
f.normalize(input, p=2, dim=2)


The dim=2 argument tells along which dimension to normalize (divide each row vector by its p-norm.
