第一种是tensor用exp函数

th> a
 1  1  0
[torch.DoubleTensor of size 1x3]

                                                                      [0.0002s]
th> a:exp()
 2.7183  2.7183  1.0000
[torch.DoubleTensor of size 1x3]

 

th> a=1
                                                                      [0.0001s]
th> b=math.exp(a)
                                                                      [0.0001s]
th> b
2.718281828459    
                                                                      [0.0001s]
th> a=3
                                                                      [0.0001s]
th> b=math.exp(a)
                                                                      [0.0001s]
th> b
20.085536923188    

 

相关文章:

  • 2022-12-23
  • 2021-10-31
  • 2022-02-22
  • 2021-12-09
  • 2021-10-05
  • 2022-12-23
  • 2022-02-13
  • 2021-05-27
猜你喜欢
  • 2021-12-12
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-06-28
  • 2022-12-23
相关资源
相似解决方案