Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct modules access when not tracing #167

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Xmaster6y
Copy link
Contributor

@Xmaster6y Xmaster6y commented Jul 2, 2024

What that this PR do?

Directly return the base model attributes when not tracing. (This is also how I understood the issue #156)

I propose to conditionally return and set attributes by checking the _tracer attribute of Envoy:

if self._envoy._tracer is None:
    return getattr(self._model, key)

return getattr(self._envoy, key)

PS

Adding envoys.append((self._module_path.lstrip("."), self)) is necessary to then manipulate modules like:

for name, module in model.named_modules():
    assert hasattr(model, name)

My bad for not including it in the first PR #165.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant