第一种是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