-
Notifications
You must be signed in to change notification settings - Fork 833
Closed
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.(Internal MS Team use only) Describes an issue with extreme impact on existing code.Regression
Milestone
Description
Please provide a succinct description of the issue.
I had the following TorchSharp code working fine in F# 6.0:
let xs = torch.zeros([|10L|], dtype=torch.float32)After upgrading to F# 7.0 the compiler started complaining:
*A unique overload for method 'zeros' could not be determined based on type information prior to this program point. A type annotation may be needed.Known types of arguments: int64 array * dtype: torch.ScalarType * device: torch.Device * requiresGrad: bool
Candidates:
- torch.zeros(size: ReadOnlySpan<int64>, ?dtype: Nullable<torch.ScalarType>, ?device: torch.Device, ?requiresGrad: bool) : torch.Tensor
- torch.zeros(size: ReadOnlySpan<int64>, ?dtype: Nullable<torch.ScalarType>, ?device: torch.Device, ?requiresGrad: bool) : torch.Tensor
- torch.zeros(size: int64 array, ?dtype: Nullable<torch.ScalarType>, ?device: torch.Device, ?requiresGrad: bool) : torch.Tensor*
It does work in F# 7.0 if I change the code to:
let xs = torch.zeros([|10L|], ?dtype=Some torch.float32)... but having to sprinkle this all over the code (in this way) is clumsy and hinders readability.
Yes, there's a workaround,
but from a usability perspective, I'd call this a regression.
Metadata
Metadata
Assignees
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.(Internal MS Team use only) Describes an issue with extreme impact on existing code.Regression
Type
Projects
Status
Done