Remove code that preserved _original_py_fns on C++ classes.

This no longer appears to be used.

PiperOrigin-RevId: 737715578
This commit is contained in:
Peter Hawkins 2025-03-17 12:42:17 -07:00 committed by jax authors
parent 9a686e0bf3
commit be5d13af77

View File

@ -668,17 +668,12 @@ def use_cpp_class(cpp_cls: type[Any]) -> Callable[[type[T]], type[T]]:
exclude_methods = {'__module__', '__dict__', '__doc__'}
originals = {}
for attr_name, attr in cls.__dict__.items():
if attr_name not in exclude_methods:
if hasattr(_original_func(attr), "_use_cpp"):
originals[attr_name] = attr
else:
if not hasattr(_original_func(attr), "_use_cpp"):
setattr(cpp_cls, attr_name, attr)
cpp_cls.__doc__ = cls.__doc__
# TODO(pschuh): Remove once fastpath is gone.
cpp_cls._original_py_fns = originals
return cpp_cls
return wrapper