[英]How to use Caffe2:TypeMeta
Caffe2:TypeMeta
的用途是什么? 我找到了这样的描述: TypeMeta is a thin class that allows us to store the type of a container such as a blob, or the data type of a tensor, with a unique run-time id. It also stores some additional data such as the item size and the name of the type for run-time inspection. Definition at line 324 of file typeid.h.
TypeMeta is a thin class that allows us to store the type of a container such as a blob, or the data type of a tensor, with a unique run-time id. It also stores some additional data such as the item size and the name of the type for run-time inspection. Definition at line 324 of file typeid.h.
但是,我真的不确定它是如何工作的。
在下面的示例中,它获取at:Tensor
的z.dtype()
,然后将其作为caffe2::TypeMeta
保存在dtype
中。
caffe2::TypeMeta dtype;
z = torch::rand({1,4});
dtype = z.dtype();
不知道这是什么意思以及如何从dtype
中获取数据,因为它在https://github.com/pytorch/pytorch/blob/master/torch/csrc/api/src/optim中完成/adam.cpp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.