megemini

Results 108 comments of megemini

> > 在 `tensor.prototype.pyi` 中增加 `EagerParamBase` 多出来的那几个属性 > > 是否可以利用「组合」?Protocol 本身就非常契合组合的概念,类似于 Java、TypeScript 的 Interface 和 Rust 的 Trait > > ```python > class Lazyable(Protocal): # 刚刚的一些独有方法 > def initialize(self): ......

### 问题4:`dtype` 是否要支持 `float` 参考示例: ``` python import paddle tensor = paddle.randn([512, 512, 512], "float") ``` 这里是不是根据当时的运行环境决定 float 为 float32、float64 或者其他类型? 目前 `DTypeLike` 只有 `floatXX` ~ 解决方案: - `DTypeLike` 增加...

### 问题5:`distributed` 有较多错误示例代码 如: ``` shell 2024-06-26 01:14:21 -------------------- 2024-06-26 01:14:21 >>> Type hints with api paddle.distributed.sharding.save_group_sharded_model:1 start ... 2024-06-26 01:14:21 import paddle 2024-06-26 01:14:21 from paddle.nn import Linear 2024-06-26...

> 支持 file level 么?只是文件级别禁用我觉得是比较合适的 https://github.com/PaddlePaddle/Paddle/pull/65496 在 `fs.py` 中加了 ignore ~ 本地测试 OK ~

### 问题6:`weight_attr` 是否标注为多个类型? 以下示例: ``` python import paddle import paddle.nn as nn linear = nn.Linear(2, 4, weight_attr=nn.initializer.KaimingNormal()) data = paddle.rand([2, 1, 2], dtype='float32') res = linear(data) print(res) ``` `nn.Linear(2, 4,...

> > 重新标注 Layer 相关的 weight_attr 为 Union > > 这种吧,看样子是个 undocumented behavior,但用的蛮多的 嗯 ~ 现在主要问题是,不清楚到底哪些可以这样用 ... ...

### Update 20240703 - 测试 `mypy == 1.10.1` 版本 > Mypy 1.10.1 > Fix error reporting on cached run after uninstallation of third party library (Shantanu, PR https://github.com/python/mypy/pull/17420) 无明显变化,不推送主版本 ~

TODO: 依赖 https://github.com/PaddlePaddle/Paddle/pull/65547 ~

### Update 20240629 All pass (bushi ~~~ 🎉🎉🎉

@enkilee ``` shell 2024-06-28 18:35:42 paddle.vision.datasets.MNIST:1 2024-06-28 18:35:42 :28:22: error: Item "Image" of "Union[Tensor, Image, ndarray[Any, dtype[Any]]]" has no attribute "shape" [union-attr] 2024-06-28 18:35:42 Found 1 error in 1 file...