"""第 08 课补全练习：按编号查行。修改 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(table, ids):
    return table[ids]

table=torch.arange(12).view(3,4)
y=solve(table,torch.tensor([1,2,1]))
assert y.shape==(3,4) and torch.equal(y[0],y[2])
print("本课补全练习通过。")
