torch 范数归一化

import torch
import torch.nn.functional as F

input = torch.nn.Parameter(torch.randn(2,3))
x = F.normalize(input, p=2, dim=1, eps=1e-12, out=None)

y = torch.norm(x,dim=1)
print(x)
print(y)

你可能感兴趣的:(深度学习,python,深度学习,机器学习)