torch.mean和torch.max函数在二维矩阵上的用法实例
>>> import torch>>> x = torch.arange(15).view(3,5)*1.0 #乘1.0因为torch.mean只能处理float类型>>> print(x)tensor([[ 0., 1., 2., 3., 4.], [ 5., 6., 7., 8., 9.], [10., 11., 12., 13., 14.]])torch.mean(input, dim,
原创
2020-09-03 11:12:44 ·
1646 阅读 ·
0 评论