diff options
| author | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
|---|---|---|
| committer | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
| commit | 4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch) | |
| tree | ee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/job_resources.py | |
| parent | cc961e04ba734dd72309fb548a2f97d67d578813 (diff) | |
| download | gn-ai-master.tar.gz | |
Diffstat (limited to '.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/job_resources.py')
| -rw-r--r-- | .venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/job_resources.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/job_resources.py b/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/job_resources.py new file mode 100644 index 00000000..bd1cdad5 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/job_resources.py @@ -0,0 +1,33 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +from typing import Any, List +from azure.ai.ml.entities._mixins import RestTranslatableMixin +from azure.ai.ml._restclient.v2024_10_01_preview.models import JobResources as RestJobResources + + +class JobResources(RestTranslatableMixin): + """Resource configuration for a job. + + This class should not be instantiated directly. Instead, use its subclasses. + """ + + def __init__(self, *, instance_types: List[str]) -> None: + self.instance_types = instance_types + + def _to_rest_object(self) -> Any: + return RestJobResources(instance_types=self.instance_types) + + @classmethod + def _from_rest_object(cls, obj: RestJobResources) -> "JobResources": + job_resources = cls(instance_types=obj.instance_types) + return job_resources + + def __eq__(self, other: object) -> bool: + if not isinstance(other, JobResources): + return NotImplemented + return self.instance_types == other.instance_types + + def __ne__(self, other: object) -> bool: + return not self.__eq__(other) |
