ml_switcheroo.frameworks.torch ============================== .. py:module:: ml_switcheroo.frameworks.torch .. autoapi-nested-parse:: PyTorch Adapter with Dynamic Introspection. Attributes ---------- .. autoapisummary:: ml_switcheroo.frameworks.torch.torch Classes ------- .. autoapisummary:: ml_switcheroo.frameworks.torch.TorchAdapter Module Contents --------------- .. py:data:: torch :value: None .. py:class:: TorchAdapter Adapter for PyTorch. .. py:attribute:: display_name :type: str :value: 'PyTorch' .. py:attribute:: inherits_from :type: None :value: None .. py:attribute:: ui_priority :type: int :value: 0 .. py:property:: search_modules :type: List[str] .. py:property:: import_alias :type: Tuple[str, str] .. py:property:: supported_tiers :type: List[ml_switcheroo.enums.SemanticTier] .. py:property:: import_namespaces :type: Dict[str, Dict[str, str]] Defines how to import specific submodules. .. rubric:: Example "torch.nn" -> `import torch.nn as nn` (root='torch', sub='nn', alias='nn') "torch.nn.functional" -> `import torch.nn.functional as F` (root='torch.nn.functional', sub=None, alias='F') .. py:property:: discovery_heuristics :type: Dict[str, List[str]] .. py:property:: test_config :type: Dict[str, str] Test templates for Torch. .. py:property:: structural_traits :type: ml_switcheroo.frameworks.base.StructuralTraits .. py:property:: definitions :type: Dict[str, ml_switcheroo.frameworks.base.StandardMap] Comprehensive distributed definitions for PyTorch mappings. Moved from standards_internal.py. .. py:property:: rng_seed_methods :type: List[str] .. py:method:: collect_api(category: ml_switcheroo.frameworks.base.StandardCategory) -> List[ml_switcheroo.frameworks.base.GhostRef] Collects API signatures dynamically. .. py:method:: get_device_syntax(device_type: str, device_index: None | str = None) -> str .. py:method:: get_serialization_imports() -> List[str] .. py:method:: get_serialization_syntax(op: str, file_arg: str, object_arg: None | str = None) -> str .. py:method:: get_example_code() -> str :classmethod: .. py:method:: get_tiered_examples() -> Dict[str, str] .. py:method:: convert(data) .. py:method:: apply_wiring(snapshot: Dict[str, Any]) -> None Applies manual fixes.