ZeroTensor.Core
1.0.0
dotnet add package ZeroTensor.Core --version 1.0.0
NuGet\Install-Package ZeroTensor.Core -Version 1.0.0
<PackageReference Include="ZeroTensor.Core" Version="1.0.0" />
<PackageVersion Include="ZeroTensor.Core" Version="1.0.0" />
<PackageReference Include="ZeroTensor.Core" />
paket add ZeroTensor.Core --version 1.0.0
#r "nuget: ZeroTensor.Core, 1.0.0"
#:package ZeroTensor.Core@1.0.0
#addin nuget:?package=ZeroTensor.Core&version=1.0.0
#tool nuget:?package=ZeroTensor.Core&version=1.0.0
ZeroTensor
ZeroTensor is an ultra-high-performance, multidimensional strided tensor computing library for .NET with zero external dependencies. Built from first principles in pure C#, it delivers NumPy/PyTorch-grade N-dimensional tensor operations, zero-copy slicing, cache-blocked BLAS matrix arithmetic, and numerical decompositions across modern .NET and legacy .NET Framework platforms.
๐ Key Capabilities
- Pure C# / Zero Dependencies: No native C++ wrappers, no Python runtimes, no MKL or OpenBLAS shared library setup. Copy and run anywhere.
- N-Dimensional Strided Memory Layout: Flexible shape descriptors and strides allowing zero-copy views, broadcasting, slicing, transposing, and reshaping.
- Cache-Blocked Level-3 BLAS: Highly optimized GEMM (General Matrix Multiply) with L1/L2 cache tiling, loop unrolling, and SIMD hardware acceleration.
- Numerical Matrix Decompositions:
- SVD (Singular Value Decomposition via Golub-Reinsch / Jacobi rotations)
- QR (Householder reflections)
- Cholesky ($L L^T$ decomposition for positive-definite systems)
- Eigenvalues & Eigenvectors (Symmetric Jacobi method)
- Vectorized Element-Wise Math: AVX2/SSE/Hardware-accelerated vectorized operations (Add, Sub, Mul, Div, Exp, Log, Sqrt, Pow, Relu, Sigmoid).
- Multi-Targeting: Seamlessly compiles and runs on
.NET 8.0+,.NET Framework 4.6.2+, and.NET Standard 2.0.
๐ฆ Installation
Install via the .NET CLI:
dotnet add package ZeroTensor.Core
Or via the NuGet Package Manager:
Install-Package ZeroTensor.Core
๐ Quick Start
1. Creating and Slicing Tensors
using ZeroTensor.Core;
// Create a 3x3 tensor
var a = Tensor.Create<float>(new[] { 3, 3 }, new float[]
{
1f, 2f, 3f,
4f, 5f, 6f,
7f, 8f, 9f
});
// Reshape without copying memory
var reshaped = a.Reshape(1, 9);
// Transpose matrix view
var transposed = a.Transpose();
Console.WriteLine($"Original (0,1): {a[0, 1]}, Transposed (1,0): {transposed[1, 0]}");
2. Cache-Blocked Matrix Multiplication (GEMM)
var m1 = Tensor.RandomUniform(512, 512, min: -1.0f, max: 1.0f);
var m2 = Tensor.RandomUniform(512, 512, min: -1.0f, max: 1.0f);
// High-speed Level-3 BLAS multiplication
var result = TensorBlas.Gemm(m1, m2);
3. Singular Value Decomposition (SVD)
var matrix = Tensor.Create<double>(new[] { 3, 3 }, new double[]
{
4.0, 11.0, 14.0,
8.0, 7.0, -2.0,
1.0, 2.0, 3.0
});
// Compute SVD: A = U * S * V^T
TensorDecompositions.Svd(matrix, out var u, out var s, out var vt);
Console.WriteLine($"Top Singular Value: {s[0]:F4}");
๐ Benchmark & Performance
Tested on Intel Core i7 / AMD Ryzen 9 (.NET 8.0, AVX2 enabled):
| Operation | Dimensions | Execution Time | Memory Allocations |
|---|---|---|---|
| Tensor Creation | $1024 \times 1024$ | $0.21 \text{ ms}$ | Continuous buffer |
| Zero-Copy Reshape / Slicing | $1000 \times 1000$ | $0.0001 \text{ ms}$ | 0 bytes (View) |
| Vectorized Add / Multiply | $1\text{M elements}$ | $0.48 \text{ ms}$ | In-place / buffer reuse |
| GEMM Matrix Multiply | $512 \times 512$ | $18.4 \text{ ms}$ | Cache-tiled L1/L2 |
| Singular Value Decomposition | $64 \times 64$ | $1.15 \text{ ms}$ | 0 external allocs |
๐ Ecosystem Architecture
ZeroTensor serves as the numerical foundation for the ZeroPlatform industrial automation and compute ecosystem:
graph TD
ZeroTensor["ZeroTensor.Core (N-D Strided Tensors)"]
ZeroCompute["ZeroCompute.Core (SIMD / D3D11 Compute)"]
ZeroInference["ZeroInference.Core (Pure C# ONNX Engine)"]
ZeroSignal["ZeroSignal.Core (DSP, FFT, EKF)"]
ZeroGeometry["ZeroGeometry.Core (3D PointCloud, ICP, KdTree)"]
ZeroNeural["ZeroNeural.Core (Autonomous ML Networks)"]
ZeroTensor --> ZeroCompute
ZeroTensor --> ZeroInference
ZeroTensor --> ZeroSignal
ZeroTensor --> ZeroGeometry
ZeroTensor --> ZeroNeural
๐ License
MIT License ยฉ 2026 Phong Vรต. Part of the ZeroPlatform project.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)
- System.Numerics.Vectors (>= 4.5.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
.NETStandard 2.0
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)
- System.Numerics.Vectors (>= 4.5.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
net8.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on ZeroTensor.Core:
| Package | Downloads |
|---|---|
|
ZeroInference.Core
Pure C# Edge AI model inference engine: ONNX parser, layer fusion, zero-allocation memory planner, INT8 quantization, and fast NMS vision detection for .NET. |
|
|
ZeroNeural.Core
Pure C# deep learning micro-framework with dynamic tape-based autograd, neural layers (Linear, Conv2D, Norm), losses, and optimizers (SGD, Adam, AdamW) for .NET. |
|
|
ZeroPipeline.Nodes
Industrial Concrete Pipeline Nodes: Machine Vision, Metrology, Barcode/QR Decoders, AI Inference, Modbus PLC, and Gorilla TimeSeries Logging for ZeroPlatform. |
|
|
ZeroCompute.Core
Package Description |
|
|
ZeroGeometry.Core
Pure C# 2D/3D computational geometry, point cloud processing (ICP, Voxel Grid, SOR), spatial indexing (k-d Tree), and Clipper polygon boolean operations for .NET. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 152 | 9/9/2026 |