quest-35b-rl / code /models /common /lightweightmodule.py
raahemnabeel's picture
tt-model push quest-35b-rl (container)
7a49daf verified
Raw History Blame Contribute Delete
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)