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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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