Pytorch-Is it possible to forward a tensor through a model (only Variable works)?

Posted quinn-yann

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Pytorch-Is it possible to forward a tensor through a model (only Variable works)?相关的知识,希望对你有一定的参考价值。

In Pytorch 0.4, I can forward a tensor through a model which is the same as Variable.

import torch
print(torch.__version__)

 

Maybe in Pytorch version < 0.4, it is not possible to forward a tensor through am model.

 

Ref to:

https://discuss.pytorch.org/t/what-is-the-difference-between-tensors-and-variables-in-pytorch/4914/3

 

The Variable class is a wrapper over torch Tensors (nd arrays in torch) that supports nearly all operations defined on tensors. PyTorch requires that the input tensor to be forward propagated has to be wrapped in a Variable. This facilitates automatic back propagation by simply calling the method backward() in the Variable class.

 

技术分享图片

 

以上是关于Pytorch-Is it possible to forward a tensor through a model (only Variable works)?的主要内容,如果未能解决你的问题,请参考以下文章

It is possible and safe to monitor a table DML history on sqlserver

It isn't possible to write into a document from an asynchronously-loaded

php https://wordpress.stackexchange.com/questions/160217/is-it-possible-to-apply-a-meta-query-to-one

sh 来自http://stackoverflow.com/questions/10018533/is-it-possible-to-git-status-only-modified-files

sh 来自http://stackoverflow.com/questions/10018533/is-it-possible-to-git-status-only-modified-files

python 来自https://stackoverflow.com/questions/5287253/is-it-possible-to-decompile-a-compiled-pyc-file