tensor&ndarray&int、float

(1) if only one element tensor, then converted to type int or float when directly int () or float () on it;

(2) If the tensor contains a plurality of elements necessary to use converted ndarray x.detach () numpy () is operated (optionally used, cpu ()).;

Guess you like

Origin www.cnblogs.com/zf-blog/p/11365083.html