如何获取张量的维度?

如何找到任意的torch7张量的维度?

我想用它来检查一个特定的张量是不是一维的,但我对任意张量都很好奇。

点赞
用户117844
用户117844
`t:dim()`

我建议您在这里阅读文档:https://github.com/torch/torch7/blob/master/doc/tensor.md

2016-01-31 14:28:54