You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Script template: add AllowUnsafeBlocks=true directive and document
why it's needed (NumSharp uses unsafe extensively)
- Linear algebra Q&A: note LAPACK bindings were removed, decomposition
methods are stubs returning null/default
- Target framework Q&A: update from "netstandard2.0" to "net8.0 and
net10.0 multi-target"
- Dependencies Q&A: note System.Memory and
System.Runtime.CompilerServices.Unsafe are now built into the runtime,
no external runtime dependencies remain
Copy file name to clipboardExpand all lines: .claude/CLAUDE.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -327,13 +327,16 @@ NumSharp has many key types/fields/methods marked `internal` (Shape.dimensions,
327
327
328
328
**How it works:** NumSharp declares `[assembly: InternalsVisibleTo("NumSharp.DotNetRunScript")]` in `src/NumSharp.Core/Assembly/Properties.cs`. The `#:property AssemblyName=NumSharp.DotNetRunScript` directive overrides the script's assembly name (which normally derives from the filename) to match, granting full access to all `internal` and `protected internal` members.
329
329
330
+
### Accessing Unsafe code
331
+
NumSharp uses unsafe in many places, hence include `#:property AllowUnsafeBlocks=true` in scripts.
A: Integer indices, string slices (`"1:3, :"`), Slice objects, boolean masks, fancy indexing (NDArray<int> indices), and mixed combinations. All in `Selection/NDArray.Indexing*.cs`.
474
477
475
478
**Q: How is linear algebra implemented?**
476
-
A: Core ops (`dot`, `matmul`) in `LinearAlgebra/`. Advanced decompositions (`inv`, `qr`, `svd`, `lstsq`) use LAPACK bindings in `Backends/LAPACK/`.
479
+
A: Core ops (`dot`, `matmul`) in `LinearAlgebra/`. Advanced decompositions (`inv`, `qr`, `svd`, `lstsq`) are stub methods that return null/default — the LAPACK native bindings they depended on have been removed.
A: MSTest framework in `test/NumSharp.UnitTest/`. Many tests adapted from NumPy's own test suite. Decent coverage but gaps in edge cases.
484
487
485
488
**Q: What .NET version is targeted?**
486
-
A: Library targets .NET Standard 2.0 for broad compatibility. Tests run on .NET 8.0.
489
+
A: Library and tests multi-target `net8.0` and `net10.0`. Dropped `netstandard2.0` in the dotnet810 branch upgrade.
487
490
488
491
**Q: What are the main dependencies?**
489
-
A: `System.Memory`(4.5.5) and `System.Runtime.CompilerServices.Unsafe` (6.0.0).
492
+
A: No external runtime dependencies. `System.Memory` and `System.Runtime.CompilerServices.Unsafe` (previously NuGet packages) are built into the .NET 8+ runtime.
490
493
491
494
**Q: What projects use NumSharp?**
492
495
A: TensorFlow.NET, ML.NET integrations, Gym.NET, Pandas.NET, and various scientific computing projects.
0 commit comments