赞
踩
>>> import torch >>> torch.manual_seed(seed=20200910) <torch._C.Generator object at 0x000001FB002DD330> >>> a = torch.randn(3,4) >>> b = a >>> a tensor([[ 0.2824, -0.3715, 0.9088, -1.7601], [-0.1806, 2.0937, 1.0406, -1.7651], [ 1.1216, 0.8440, 0.1783, 0.6859]]) >>> b tensor([[ 0.2824, -0.3715, 0.9088, -1.7601], [-0.1806, 2.0937, 1.0406, -1.7651], [ 1.1216, 0.8440, 0.1783, 0.6859]]) >>> a.fill_(20200910.0) tensor([[20200910., 20200910., 20200910., 20200910.], [20200910., 20200910., 20200910., 20200910.], [20200910., 20200910., 20200910., 20200910.]]) >>> a tensor([[20200910., 20200910., 20200910., 20200910.], [20200910., 20200910., 20200910., 20200910.], [20200910., 20200910., 20200910., 20200910.]]) >>> b tensor([[20200910., 20200910., 20200910., 20200910.], [20200910., 20200910., 20200910., 20200910.], [20200910., 20200910., 20200910., 20200910.]]) >>> >>> >>>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。