"""第 14 课补全练习：保留残差通路。修改 solve，保持下方检查不变。"""
import math, io, argparse
import torch
from torch import nn
from torch.nn import functional as F
torch.set_num_threads(2)
torch.manual_seed(26)

def solve(x, branch):
    return x + branch(x)

x=torch.tensor([1.,2.])
torch.testing.assert_close(solve(x,lambda x:x*.1),torch.tensor([1.1,2.2]))
print("本课补全练习通过。")
