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