Default printing of tensors in notebooks causes exception
See original GitHub issueThe default printing of scalar tensors in F# .NET Interactive notebooks causes an exception:
-
create an F# notebook at https://mybinder.org/v2/gh/dotnet/interactive/master?urlpath=lab
-
Run this
#i "nuget: https://ci.appveyor.com/nuget/diffsharp"
#r "nuget: DiffSharp-lite,0.9.5-preview-2006281542" // update version as needed, see a recent build in https://ci.appveyor.com/project/dsyme/diffsharp/history
open DiffSharp
dsharp.tensor 3.0
Expected: nice printing of tensor
Actual: exception "Cannot enumerate Tensor with dim "
Oddly also applies to tensors of any dimension.
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1639.Invoke(String message) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1639
at DiffSharp.Tensor.System-Collections-Generic-IEnumerable`1-GetEnumerator()
at System.Linq.Enumerable.SelectIterator[TSource,TResult](IEnumerable`1 source, Func`3 selector)+MoveNext()
at Microsoft.DotNet.Interactive.Formatting.EnumerableExtensions.TakeAndCountRemaining[T](IEnumerable`1 source, Int32 count) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive.Formatting\EnumerableExtensions.cs:line 19
at Microsoft.DotNet.Interactive.Formatting.HtmlFormatter`1.<>c__DisplayClass7_0.<CreateForSequence>g__BuildTable|3(T source, TextWriter writer) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive.Formatting\HtmlFormatter{T}.cs:line 112
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Clarifying exceptions and visualizing tensor operations in ...
The following subsections illustrate the anemic default exception messages and my proposed TensorSensor approach, rather than a debugger or print statements ...
Read more >RuntimeError: Expected all tensors to be on the same ...
else: print("MPS is available. Setting as default device.") mps_device = torch.device("mps") default_device(mps_device).
Read more >Internal error: Failed to apply delegate: Attempting to use a ...
java.lang.IllegalArgumentException: Internal error: Failed to apply delegate: Attempting to use a delegate that only supports static-sized tensors with a graph ...
Read more >Default printer choice doesn't stick
Is possible the option 'Let Windows manage my default printer' is enabled and is causing this problem. 1-Click on Start then click on...
Read more >What to do when you get an error
In this section we'll look at some common errors that can occur when you're trying to generate predictions from your freshly tuned Transformer...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
thanks!
Ok, I’m convinced. We can merge #153 and move on. I think the Tensor -> IEnumerable use case is also available through the
.unstack()
method that you used in the PR.I think the formatter for dotnet interactive is a separate issue we can work on.