"docs/git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "358e9e931dabde76f36493aaa09060d3824fc84f"
Unverified Commit da0e3452 authored by Jeffrey Morgan's avatar Jeffrey Morgan Committed by GitHub
Browse files

ml: use input context for extracting outputs (#9875)

parent df94175a
...@@ -179,7 +179,7 @@ func (m *Model) Forward(ctx ml.Context, opts input.Options) (ml.Tensor, error) { ...@@ -179,7 +179,7 @@ func (m *Model) Forward(ctx ml.Context, opts input.Options) (ml.Tensor, error) {
return nil, err return nil, err
} }
outputs, err := ctx.Output().FromIntSlice(opts.Outputs, len(opts.Outputs)) outputs, err := ctx.Input().FromIntSlice(opts.Outputs, len(opts.Outputs))
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -150,7 +150,7 @@ func (m *Model) Forward(ctx ml.Context, opts input.Options) (ml.Tensor, error) { ...@@ -150,7 +150,7 @@ func (m *Model) Forward(ctx ml.Context, opts input.Options) (ml.Tensor, error) {
return nil, err return nil, err
} }
outputs, err := ctx.Output().FromIntSlice(opts.Outputs, len(opts.Outputs)) outputs, err := ctx.Input().FromIntSlice(opts.Outputs, len(opts.Outputs))
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -150,7 +150,7 @@ func (m *Model) Forward(ctx ml.Context, opts input.Options) (ml.Tensor, error) { ...@@ -150,7 +150,7 @@ func (m *Model) Forward(ctx ml.Context, opts input.Options) (ml.Tensor, error) {
return nil, err return nil, err
} }
outputs, err := ctx.Output().FromIntSlice(opts.Outputs, len(opts.Outputs)) outputs, err := ctx.Input().FromIntSlice(opts.Outputs, len(opts.Outputs))
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -154,7 +154,7 @@ func (m *Model) Forward(ctx ml.Context, opts input.Options) (ml.Tensor, error) { ...@@ -154,7 +154,7 @@ func (m *Model) Forward(ctx ml.Context, opts input.Options) (ml.Tensor, error) {
return nil, err return nil, err
} }
outputs, err := ctx.Output().FromIntSlice(opts.Outputs, len(opts.Outputs)) outputs, err := ctx.Input().FromIntSlice(opts.Outputs, len(opts.Outputs))
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment