求平均值

th> a=torch.zeros(1,3)
                                                                      [0.0002s]
th> a
 0  0  0
[torch.DoubleTensor of size 1x3]

                                                                      [0.0003s]
th> a[{1,1}]=1
                                                                      [0.0001s]
th> a[{1,2}]=2
                                                                      [0.0001s]
th> a[{1,3}]=3
                                                                      [0.0000s]
th> a
 1  2  3
[torch.DoubleTensor of size 1x3]

                                                                      [0.0003s]
th> b=a:mean()
                                                                      [0.0001s]
th> b
2    

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2021-12-23
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-21
  • 2021-06-11
  • 2022-12-23
相关资源
相似解决方案