MCPcopy Create free account
hub / github.com/pytorch/pytorch / with_options

Method with_options

torch/utils/cpp_extension.py:481–488  ·  view source on GitHub ↗

Return a subclass with alternative constructor that extends any original keyword arguments to the original constructor with the given options.

(cls, **options)

Source from the content-addressed store, hash-verified

479
480 @classmethod
481 def with_options(cls, **options):
482 """Return a subclass with alternative constructor that extends any original keyword arguments to the original constructor with the given options."""
483 class cls_with_options(cls): # type: ignore[misc, valid-type]
484 def __init__(self, *args, **kwargs):
485 kwargs.update(options)
486 super().__init__(*args, **kwargs)
487
488 return cls_with_options
489
490 def __init__(self, *args, **kwargs) -> None:
491 super().__init__(*args, **kwargs)

Callers 2

setup.pyFile · 0.80
setup.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected