繁体   English   中英

如何使用 Caffe2:TypeMeta

[英]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:Tensorz.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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM