Build two Linear(4, 2) layers with different seeds -- seed_source then
seed_target -- so they start with different weights. Copy all learned state
from the source into the target using the state-dictionary API.
Return the tuple (source_output, target_output) for the same input x, under
torch.no_grad(). After a correct copy the two are identical.
Input
x =
tensor([[1., 1., 1., 1.],
[1., 1., 1., 1.]])
seed_source = 0
seed_target = 1
Output
(tensor([[-0.5594, 0.4603],
[-0.5594, 0.4603]]), tensor([[-0.5594, 0.4603],
[-0.5594, 0.4603]]))