- 博客(3)
- 问答 (1)
- 收藏
- 关注
原创 torch.nn.CosineSimilarity() 三维张量
对于三维张量:import torcha = torch.tensor([[[-1., 0]], [[1., 0]]])b = torch.tensor([[[1., 1.], [2., 1.]]])print(a.shape)print(b.shape)x = torch.nn.CosineSimilarity(-1)result = x(a, b)print(result)输出:torch.Size([2, 1, 2]) # 张量a的形状torch.Size([1,
2022-05-23 18:09:39
3564
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人