簡體   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