Say I have data, a batched tensor of collections of data points of size (B, N, D) where B is my batch size, N is the number of data samples in each collection, and D is the length of my data vectors. I want to compute the sample mean and covariance for each collection of data points, but do it in batch.
To compute the mean I can do data.mean(dim=1) and I get a tensor of size (B, D) representing the mean of each collection. I assumed I'd be able to do a similar thing with torch.cov but it does not offer the ability to do it in batch. Is there another way to achieve this? I'm expecting to get a batch of covariance matrices of shape (B, D, D).