I found that there is a similar question: Link. 
Does there exists a fast PyTorch implementation that supports batch processing? (I have B instances, each instance contains N C-dimensional points, i.e. the shape of input data is [B, C, N])