请按照初始代码中的签名实现 MyLinear 类。
weight 为 (out_features, in_features) float32,bias 为 (out_features,) float32;x 为 (B, in_features) float32,1 <= B <= 16,1 <= in/out_features <= 128。
基础前向
正确性调用
MyLinear(tensor[3, 4] [0.849843, 0.699152, -0.557211, -0.250312, -0.738355, -1.3818, …], tensor[3] [0.378108,0.493785,0.250949]).forward(tensor[2, 4] [0.477765,0.160082,2.077871,0.999669,-0.615789,0.380278,0.390547,-0.18249])
预期结果
tensor[2, 3] [-0.511987,1.229869,-0.233875,-0.051282,0.034701,-0.197988]
运行会检查可见示例,提交会运行完整的隐藏测试。
登录并提交后,你的提交记录会显示在这里。