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

[Question & FeatureRequest] Is that possible to convert a torch.nn.Module to TRTMoudle? #917

Open
ElinLiu0 opened this issue Feb 23, 2024 · 1 comment

Comments

@ElinLiu0
Copy link

ElinLiu0 commented Feb 23, 2024

For example,i got a module class which based on torch.nn.Moudle() like this:

model = VALLE(
        N_DIM,
        NUM_HEAD,
        NUM_LAYERS,
        norm_first=True,
        add_prenet=False,
        prefix_mode=PREFIX_MODE,
        share_embedding=True,
        nar_scale_factor=1.0,
        prepend_bos=True,
        num_quantizers=NUM_QUANTIZERS,
).to(device)

Is that possible convert this module class into a TRTMoudle individually,and still can be using the methods and attributes from VALLE?
I am seen that TRTMoudle has a function load_state_dict(),will it have a simple convert like somehow,uh..
TRTModule.from_torch() or something?

@ElinLiu0
Copy link
Author

And then just seperate the module initailize and state_dict() loading.

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

No branches or pull requests

1 participant