Fix obsured warning (#1944)

This commit is contained in:
Chunyang Wen
2025-03-09 06:50:39 +08:00
committed by GitHub
parent d699cc1330
commit 5db90ce822

View File

@@ -598,9 +598,7 @@ class Module(dict):
parameters to the new dtype.
"""
if predicate is None:
def predicate(_):
return True
predicate = lambda _: True
self.apply(lambda x: x.astype(dtype) if predicate(x.dtype) else x)