Download code/models/common/lightweightmodule.py from changh95/moge-2-p150: direct link, hf CLI and curl.
- Browser
- Download file 405 Bytes
-
https://huggingface.co/changh95/moge-2-p150/resolve/main/code/models/common/lightweightmodule.py
- Command line
-
hf download hf://changh95/moge-2-p150/code/models/common/lightweightmodule.py
-
curl -L -o lightweightmodule.py https://huggingface.co/changh95/moge-2-p150/resolve/main/code/models/common/lightweightmodule.py
405 Bytes
| # SPDX-FileCopyrightText: © 2023 Tenstorrent USA, Inc. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| class LightweightModule: | |
| """Torch modules add a surprising amount of host overhead for attribute | |
| access and method calls. This class is a lightweight alternative that | |
| just wraps a forward function for now.""" | |
| def __call__(self, *args, **kwargs): | |
| return self.forward(*args, **kwargs) | |