Files
pytorch/torch/_opaque_base.py
angelayi c8f7e7cd39 Rename OpaqueBase to CustomClassBase (#188455)
Introduces torch._custom_class_base with CustomClassBase and
CustomClassBaseMeta as the new canonical base classes. The old
torch._opaque_base module becomes a backward-compat shim that
re-exports with DeprecationWarning.

Updates all import sites across dynamo, functorch, inductor, export,
distributed, and tests to use the new names.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/188455
Approved by: https://github.com/zou3519
2026-07-03 01:04:12 +00:00

12 lines
272 B
Python

import logging
log = logging.getLogger(__name__)
log.warning("torch._opaque_base is deprecated, use torch._custom_class_base instead")
from torch._custom_class_base import ( # noqa: F401
CustomClassBase as OpaqueBase,
CustomClassBaseMeta as OpaqueBaseMeta,
)