th> a=torch.zeros(1,5)
                                                                      [0.0001s]
th> a
 0  0  0  0  0
[torch.DoubleTensor of size 1x5]

                                                                      [0.0001s]
th> a[{1,floor}]=1
                                                                      [0.0001s]
th> a
 1  1  1  1  1
[torch.DoubleTensor of size 1x5]

                                                                      [0.0001s]
th> a[{1,ceil}]=0.5
                                                                      [0.0001s]
th> a
 0.5000  0.5000  0.5000  0.5000  0.5000
[torch.DoubleTensor of size 1x5]

 

相关文章:

  • 2021-11-25
  • 2021-10-19
  • 2021-05-26
  • 2021-12-21
  • 2021-08-07
  • 2021-06-03
  • 2021-09-02
  • 2022-01-03
猜你喜欢
  • 2022-12-23
  • 2021-06-01
  • 2022-03-08
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
相关资源
相似解决方案