torsh-core
Core types and traits for the ToRSh deep learning framework.
Overview
This crate provides the fundamental building blocks used throughout ToRSh:
- Device abstraction: Unified interface for CPU, CUDA, Metal, and WebGPU backends
- Data types: Support for various tensor element types (f32, f64, i32, etc.)
- Shape utilities: Shape manipulation, broadcasting, and stride calculations
- Storage abstraction: Backend-agnostic tensor storage with reference counting
- Error types: Comprehensive error handling for ToRSh operations
Features
std(default): Standard library supportno_std: No standard library (for embedded targets)serialize: Serialization support via serde
Usage
use *;
// Create a shape
let shape = new;
println!;
// Device management
let device = CpuDevice;
println!;
// Data types
let dtype = F32;
println!;
Integration with SciRS2
This crate builds on top of scirs2 for core scientific computing functionality, providing a PyTorch-compatible API layer.
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.