rustorch 0.6.29

Production-ready PyTorch-compatible deep learning library in Rust with special mathematical functions (gamma, Bessel, error functions), statistical distributions, Fourier transforms (FFT/RFFT), matrix decomposition (SVD/QR/LU/eigenvalue), automatic differentiation, neural networks, computer vision transforms, complete GPU acceleration (CUDA/Metal/OpenCL), SIMD optimizations, parallel processing, WebAssembly browser support, comprehensive distributed learning support, and performance validation
Documentation
#!/usr/bin/env node
/**
 * Basic test for RusTorch WASM examples
 */

import fs from 'fs';
import path from 'path';

console.log('๐Ÿงช Running RusTorch WASM tests...');

// Test 1: Check if WASM files exist
const pkgDir = './pkg';
const wasmFile = path.join(pkgDir, 'rustorch_bg.wasm');
const jsFile = path.join(pkgDir, 'rustorch.js');

if (!fs.existsSync(wasmFile)) {
    console.error('โŒ WASM file not found:', wasmFile);
    console.log('๐Ÿ’ก Run "npm run build-wasm" first');
    process.exit(1);
}

if (!fs.existsSync(jsFile)) {
    console.error('โŒ JS binding file not found:', jsFile);
    console.log('๐Ÿ’ก Run "npm run build-wasm" first');
    process.exit(1);
}

console.log('โœ… WASM files found');
console.log('โœ… JS binding files found');

// Test 2: Check file sizes
const wasmStats = fs.statSync(wasmFile);
const jsStats = fs.statSync(jsFile);

console.log(`๐Ÿ“Š WASM file size: ${(wasmStats.size / 1024).toFixed(2)} KB`);
console.log(`๐Ÿ“Š JS file size: ${(jsStats.size / 1024).toFixed(2)} KB`);

if (wasmStats.size < 1000) {
    console.warn('โš ๏ธ  WASM file seems too small, build might be incomplete');
    process.exit(1);
}

console.log('โœ… All tests passed!');
console.log('๐ŸŽ‰ RusTorch WASM examples are ready to run');