lua中特殊用法

 

 

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]

 

posted @ 2016-12-23 15:06  有梦就要去实现他  阅读(321)  评论(0编辑  收藏  举报