Skip to content

Misleading error report on missing method #14410

@pkese

Description

@pkese

image

Description of the issue

In the above code, I mistyped the word torch.nn.functional.gauss{ui}an_nll_loss and the compiler complained not that gaussuan_nll_loss is missing, but rather that whole nn is missing which is incorrect as well as misleading (I've spent lots of time trying to figure out why nn would be missing.

Sample code

#r "nuget: TorchSharp, 0.99.0"
#r "nuget: libtorch-cpu-linux-x64, 1.13.0.1"
open TorchSharp

let xs = torch.ones(10)
let loss = torch.nn.functional.gaussuian_nll_loss(xs, xs, xs)

Expected behavior

Error: input.fsx (4,18)-(4,20) typecheck error The type 'torch.nn.functional' does not define the field, constructor or member 'gaussuan_nll_loss'.

Actual behavior

Error: input.fsx (4,18)-(4,20) typecheck error The type 'torch' does not define the field, constructor or member 'nn'.

Operating system

  • Ubuntu Linux 22.04, dotnet sdk 6.0.110

Same problem happens with .ipynb or .fsx files.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions