【发布时间】:2016-02-25 15:28:52
【问题描述】:
我有一个张量,它是一个包含 9 个单元的向量,我想像在 Matlab 中一样将单元 3 到 6 拉出来而不循环。
更多信息:
th> my_table = {0.1, 0.2, 0.3, ... 0.9}
-- I create tensor out of it.
th> t_table = torch.Tensor(my_table )
-- I get the vector 0.1, 0.2, 0.3, ..., 0.9
-- Now I will get it's mean like this:
th> torch.mean(t_table)
0.5
-- Now I would like to do for example torch.mean on cells 3-6.
th> --<what to write here?>
【问题讨论】: