I have written a code in lua for PCA. Any one help to convert this code into Pytorch, please?
function unsup.pcacov(x)
local mean = torch.mean(x,1)
local xm = x - mean:expandAs(x)
local c = torch.mm 13(xm:t(),xm)
c:div(x:size(1)-1)
local ce,cv = torch.symeig(c,‘V’)
return ce,cv
end