摘要: 在看别人的代码的时候你是否会看到经常会有这种情况 def haha(aa:str) -> np.ndarray: pass 这里面的:str还有->代表什么呢? 其实他们就是为了让我们的代码的函数更加容易理解,规范输入输出的类型,所以使用了函数的类型注释器 :str 代表haha函数中的输入aa参数 阅读全文
posted @ 2025-10-16 01:23 AttaSayyid 阅读(3) 评论(0) 推荐(0)
摘要: import numpy as np from utils.features import prepare_for_training # 预处理 import torch as t # 现在开始构建线性回归 class LinearRegression(): """ 总结一下这个函数具体做了什么事情 阅读全文
posted @ 2025-10-16 01:11 AttaSayyid 阅读(8) 评论(0) 推荐(0)