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

Module.forward afford one param Tensor ? #1233

Closed
ElinLiu0 opened this issue Feb 11, 2024 · 1 comment
Closed

Module.forward afford one param Tensor ? #1233

ElinLiu0 opened this issue Feb 11, 2024 · 1 comment

Comments

@ElinLiu0
Copy link

I have write a forward() method like below:

public override Tensor forward(Tensor input,Tensor cond_embedding_id)
{
    var Scales = this.scale.forward(cond_embedding_id);
    var Shift = this.shift.forward(cond_embedding_id);
    input = nn.functional.layer_norm(input, [this.dim,],null,null,eps);
    input = input * Scales + Shift;
    return input;
}

But visual studio raise an error:

Severity code description: Project file line suppression status
Error CS0115 "AdaLayerNorm. forward (torch. Tensor, torch. Tensor)": No suitable method was found to override VALLESharp D: \ VALLESharp \ VALLESharp \ Vocos \ Modules. cs 42 Activity

Ha?

@ElinLiu0
Copy link
Author

Solved by adding another Tensor parma when model class assigning like below:

internal class AdaLayerNorm : Module<Tensor,Tensor, Tensor>

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