mindspore.Tensor.flush_from_cache

查看源文件
mindspore.Tensor.flush_from_cache()[源代码]

如果Tensor开启缓存作用,则将缓存数据刷新到host侧。

样例:

>>> from mindspore import Tensor
>>> import numpy as np
>>> x = Tensor(np.array([1, 2], dtype=np.float32))
>>> y = x.flush_from_cache()
>>> print(y)
None