Skip to content
CAI
Software that uses CAICheck a score

bytedeco/storch

54.2

Adequate · 20 September 2026

11.2k

lines of production code

Scala

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Storch is a GPU-accelerated deep learning library for Scala 3 that provides a PyTorch-like API for tensor computations and neural network construction. It wraps native PyTorch bindings to expose core capabilities including tensor manipulation, data loading, and a comprehensive suite of neural network modules such as convolutions, normalization, and optimizers. The system supports end-to-end model development by including utilities for weight conversion, dataset handling, and training workflows, as demonstrated by its included LeNet and GPT examples.

Features

Add AdaptiveAvgPool2d and MaxPool2d pooling modules

New 2D pooling layers are now available in the torch.nn module. AdaptiveAvgPool2d applies adaptive average pooling to reduce spatial dimensions to a specified output size, while MaxPool2d applies max pooling with configurable kernel size, stride, padding, dilation, and ceil mode. These modules bridge the Scala API to the underlying PyTorch native implementations, enabling users to perform standard 2D pooling operations on tensors.

core/src/main/scala/torch/nn/modules/pooling · high confidence

Add BatchNorm1d and BatchNorm2d modules

Added new \BatchNorm1d\ and \BatchNorm2d\ modules to the \torch.nn\ package, enabling 1D (temporal) and 2D (spatial) batch normalization for deep learning models. These modules wrap the underlying PyTorch native implementations, supporting configurable parameters such as \numFeatures\, \eps\, \momentum\, \affine\, and \trackRunningStats\ to control learnable affine transformations and running statistics tracking.

core/src/main/scala/torch/nn/modules/batchnorm · high confidence

Add Embedding module for sparse lookup tables

Users can now use the new Embedding module, which provides a lookup table to store and retrieve embeddings by index. This module supports configuration for padding indices, weight normalization (max norm), and sparse gradient updates, mapping directly to the underlying PyTorch Embedding implementation.

core/src/main/scala/torch/nn/modules/sparse · high confidence

Add GroupNorm and LayerNorm normalization modules

New GroupNorm and LayerNorm modules have been added to the torch.nn package, providing normalization capabilities for mini-batch inputs. GroupNorm separates channels into groups and supports learnable affine parameters, while LayerNorm normalizes over the last D dimensions of the input and supports per-element affine transforms via elementwise\_affine. These modules wrap the underlying PyTorch native implementations and expose weight and bias tensors for model training.

core/src/main/scala/torch/nn/modules/normalization · high confidence

Add LeNet example for MNIST classification

A new LeNet example has been added to the examples directory, demonstrating how to train a convolutional neural network on the MNIST dataset using the Storch vision library. The example includes a complete implementation of the LeNet architecture, data loading from MNIST, training loop with AMSGrad optimizer, and evaluation metrics. It supports both CPU and CUDA devices, with instructions for enabling GPU support via PyTorch platform dependencies.

examples/src/main/scala · high confidence

Add Linear and Identity neural network modules

Introduces the \Linear\ and \Identity\ modules in the \torch.nn.modules.linear\ package. The \Linear\ module applies a linear transformation ($y = xA^T + b$) to incoming data, supporting configurable input/output feature sizes and optional bias terms, while the \Identity\ module serves as a placeholder operator that passes inputs through unchanged.

core/src/main/scala/torch/nn/modules/linear · high confidence

Add MNIST and Fashion-MNIST datasets with image preprocessing transforms

Users can now load the MNIST and Fashion-MNIST datasets directly via the \torchvision.datasets\ package, with automatic download and extraction support. The release also introduces image preprocessing capabilities in \torchvision.transforms\, including functional utilities to convert between images and tensors, normalize data, and a preset pipeline for image classification that handles resizing, cropping, and normalization.

vision · high confidence

Add ModuleList and Sequential container modules

New \ModuleList\ and \Sequential\ classes are now available in the \torch.nn.modules.container\ package. \ModuleList\ allows users to hold submodules in a list that is properly registered with the parent module, supporting indexing, iteration, and methods like \append\, \insert\, and \extend\. \Sequential\ provides a simple way to apply a sequence of modules to an input tensor in order. Both classes ensure contained modules are visible to standard \Module\ methods.

core/src/main/scala/torch/nn/modules/container · high confidence

Add activation modules: LogSoftmax, ReLU, Softmax, and Tanh

New activation layer modules have been added to the \torch.nn.modules.activation\ package, providing wrappers for LogSoftmax, ReLU, Softmax, and Tanh. These modules allow users to apply standard activation functions to tensors, with ReLU supporting an optional \inplace\ parameter and Softmax/LogSoftmax accepting a \dim\ argument to specify the dimension along which the function is applied.

core/src/main/scala/torch/nn/modules/activation · high confidence

Add script to convert PyTorch ResNet weights for LibTorch compatibility

A new script at scripts/convert-weights/convert\_weights.py has been added to download and convert pre-trained ResNet weights (ResNet18, ResNet34, ResNet50, ResNet101, ResNet152) from PyTorch's torchvision library. The script converts parameters from torch.nn.Parameter to regular tensors, enabling these models to be loaded via LibTorch, and saves the converted state dictionaries into the models directory.

scripts · high confidence

Added pre-push linting and formatting checks

A new pre-push git hook has been introduced to automatically run SBT-based linting and formatting checks (headerCheckAll, scalafmtCheckAll, scalafmtSbtCheck) before code is pushed to the remote repository, ensuring code style consistency.

git-hooks · high confidence

Initial implementation of optimizers and learning rate schedulers

This change introduces the core optimization components for the library, adding the base Optimizer class and concrete implementations for Stochastic Gradient Descent (SGD), Adam, and AdamW. It also includes the learning rate scheduling infrastructure, featuring the LRScheduler trait and a StepLR scheduler that decays the learning rate by a specified gamma every step\_size epochs. These classes wrap the underlying PyTorch native optimizers and schedulers, providing a Scala API for parameter updates and gradient management.

core/src/main/scala/torch/optim · high confidence

Initial release of core tensor, data, and vision model abstractions

This change introduces the foundational types for the library, including the \DType\ enum covering PyTorch's twelve data types (such as float32, int64, and bool), the \Device\ abstraction for CPU/GPU selection, and the \Tensor\ class with basic arithmetic and indexing operations. It also adds the \Example\ case class for pairing features with targets and provides the \indexing\ utilities for slice and ellipsis access. Additionally, it includes the \ResNet\ architecture implementation in the vision module and a generic \ImageClassifier\ example script that demonstrates training and evaluation workflows.

repository · high confidence

New GPT example implementation with utility helpers

Added a new GPT example in the \examples/src/main/scala/gpt\ directory, featuring a \V2.scala\ implementation of Andrej Karpathy's GPT model and a \Utils.scala\ file providing helper functions for tensor operations, human-readable size/duration formatting, and CUDA memory statistics.

examples/src/main/scala/gpt · high confidence

New core module infrastructure and initial layer implementations

This change introduces the foundational \Module\ base class in \torch.nn.modules\, providing essential capabilities for managing child modules, parameters, buffers, and state dictionary loading. Alongside this infrastructure, it adds initial neural network layer implementations including \Conv2d\ (with support for various padding modes), \Flatten\, and the \CrossEntropyLoss\ criterion, enabling users to construct and train basic neural network models.

core/src/main/scala/torch/nn/modules · high confidence

New data loading primitives: DataLoader, TensorDataset, and TensorSeq

The core library now includes foundational data handling components in the \torch.data\ package. Users can wrap individual tensors or pairs of feature/target tensors using \TensorSeq\ and \TensorDataset\ to create indexable datasets. These datasets can then be consumed by \DataLoader\, which supports configurable batch sizes, optional shuffling, and custom collation functions to group samples into batches for training or inference.

core/src/main/scala/torch/data · high confidence

New functional API for core neural network layers

The \torch.nn.functional\ package now exposes a comprehensive set of functional operations for building neural networks, including activation functions (logSoftmax, relu, sigmoid, silu, softmax), convolution layers (1D/2D/3D and transposed variants), pooling operations (avgPool and maxPool for 1D/2D/3D), linear transformations (linear, bilinear), dropout, loss functions (binaryCrossEntropyWithLogits, crossEntropy), and sparse utilities (oneHot). These functions are implemented as thin wrappers around the underlying native PyTorch bindings, allowing users to apply these operations directly to tensors without instantiating module classes.

core/src/main/scala/torch/nn/functional · high confidence

New modular torch ops API with expanded tensor operations

The \core/src/main/scala/torch/ops\ package has been restructured into a modular set of traits (e.g., \BLASOps\, \CreationOps\, \ReductionOps\, \IndexingSlicingJoiningOps\, \PointwiseOps\, \RandomSamplingOps\, \OtherOps\) to organize tensor operations. This change introduces a wide range of new capabilities for users, including BLAS operations like \matmul\, creation ops such as \zeros\, \ones\, \arange\, and \linspace\, reduction ops like \argmax\, \argmin\, \amax\, \amin\, and \aminmax\, and indexing/slicing operations including \cat\, \chunk\, \split\, \adjoint\, and \argwhere\. It also adds pointwise operations (e.g., \abs\, \add\, \bitwiseAnd\), random sampling functions (\rand\, \randint\, \randn\, \multinomial\), and other utilities like \einsum\ and \trace\. The \package.scala\ provides internal helpers like \xLike\ to support these new ops.

core/src/main/scala/torch/ops · high confidence

New nn package exports and utility modules

The \torch.nn\ package now exposes a curated set of neural network modules and utilities directly, including \Module\, \Sequential\, \ModuleList\, \Linear\, \Conv2d\, \BatchNorm1d\, \BatchNorm2d\, \LayerNorm\, \GroupNorm\, \Dropout\, \Embedding\, \Softmax\, \LogSoftmax\, \ReLU\, \Tanh\, \Flatten\, \MaxPool2d\, \AdaptiveAvgPool2d\, \Identity\, and \CrossEntropyLoss\. Additionally, new files introduce tensor initialization functions (e.g., \uniform\\, \normal\\, \zeros\\, \ones\\, \eye\\, \calculateGain\) in \init.scala\ and gradient clipping utilities (\clipGradNorm\\) in \utils.scala\, providing users with direct access to common PyTorch-compatible operations without navigating deep package paths.

core/src/main/scala/torch/nn · high confidence

New special math functions and internal conversion utilities

This change introduces a new \torch.special\ package exposing specialized mathematical operations such as digamma, erf, erfinv, logit, and xlogy, allowing users to perform advanced tensor computations. It also adds the \NativeConverters\ internal module, which provides extension methods and utilities for converting Scala types (including scalars, options, and complex numbers) to PyTorch native types, supporting the new API and improving type safety for tensor creation and manipulation.

core/src/main/scala/torch/internal · high confidence

New torch core utilities and type definitions

This change introduces several new components to the core torch package: a Generator class for managing random number generation states on CPU and CUDA devices; Layout and MemoryFormat enums to represent tensor memory layouts (such as Strided, Sparse, and ChannelsLast); and a hub object that provides utilities to download and cache pre-trained model weights from URLs. Additionally, it adds a package object with a noGrad context manager for disabling gradient calculation during inference, and various type definitions and helpers in Types.scala to support tensor operations.

core/src/main/scala/torch · high confidence

Removals

Removed initial Scala 3 hello-world entry point

The initial \Main.scala\ entry point, which printed a static "Hello world!" message and a compile-time version string, has been removed from the application. This cleanup removes the placeholder code from the main source directory as the project structure evolves.

src/main · high confidence

Behavioural changes

Project rebranded to Storch with Apache 2.0 license and updated documentation

The project has been rebranded as Storch, a GPU-accelerated deep learning library for Scala 3, and is now licensed under the Apache License 2.0. The README has been updated to reflect this new identity, providing an overview of the library's PyTorch-like API for tensor computations and neural networks, along with usage examples. Additionally, the repository now includes a CONTRIBUTING guide and configuration files for devenv and scalafmt to support the development workflow.

(repo-wide) · high confidence

Redesigned landing page with new branding and embedded media

The site's landing page has been updated with a new visual identity and content structure. A custom SVG logo (storch.svg) is now included, accompanied by specific CSS styles in custom.css that adjust header typography and teaser layout for better presentation. The landing page content (landing-page.md) now features an embedded Scala Days video and an asciinema demo, with a JavaScript module (render-katex.js) added to support mathematical rendering on the page.

site · high confidence

Website generation switched to Laika with updated build tooling

The project's website generation has been migrated to the Laika documentation engine (via sbt-typelevel-site), introducing a redesigned landing page with specific metadata, navigation links, and integrated KaTeX support for mathematical rendering. This change is accompanied by an upgrade of the build tool from sbt 1.6.2 to 1.9.8 and the addition of new SBT plugins for code formatting and documentation generation.

project · high confidence

Test coverage

Expanded test coverage for tensor operations and neural network modules; Removed initial MUnit test suite.

Dependencies

Upgrade PyTorch to 2.1.2 and Scala to 3.3.1

The project dependencies have been updated to use PyTorch 2.1.2 (via JavaCPP 1.5.10) and Scala 3.3.1. The build configuration also introduces version variables for CUDA 12.3, OpenBLAS 0.3.26, and MKL 2024.0, allowing users to benefit from the latest PyTorch features and stability improvements while maintaining compatibility with the underlying native libraries.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 54.

Lenses

  • Code Health 82
  • Architecture 96
  • Maturity 33
  • Readiness 63
  • Security 81

Changes since last survey

  • 179 commits — 153 feature/other, 26 fixes

By area

  • core/src — 75 commits
  • (repo) — 44 commits
  • (root) — 30 commits
  • examples/src — 10 commits
  • site/src — 6 commits
  • .github/workflows — 3 commits
  • vision/src — 3 commits
  • storch-site/docusaurus.config.js — 2 commits
  • storch/src — 2 commits
  • docs/tutorial — 1 commit
  • src/main — 1 commit
  • storch-site/static — 1 commit
  • website/static — 1 commit

Notable commits

  • fix: 2. try to fix instance check by also inlining genTensor parameter
  • fix: Add einsum, more methods on Tensor and fixes
  • fix: Add evaluation to LeNet example and fix division type promotion
  • fix: Allow running LeNet example on GPU and fix memory and convergence issues
  • fix: Fix and improve initializing modules with other parameter types
  • fix: Fix avg-pooling and add dtype tests for it
  • fix: Fix complement-property testing
  • fix: Fix complex number Tensor creation and item accessor + enable tests that use it
  • fix: Fix deprecation warnings
  • fix: Fix deprecation warnings in tests
  • fix: Fix directives in image classification example
  • fix: Fix dist promoted type and add missing FloatPromoted cases
  • fix: Fix embarassingly wrong handling of uint8
  • fix: Fix randint to take a long as high value and add tensor options
  • fix: Fix scala-cli deps and repos after update to pytorch snapshots
  • fix: Fix tests
  • fix: Fix torch.randn to use proper native function
  • fix: Fix torchvision package
  • fix: Fix warnings with new compiler options
  • fix: Make genTensor transparent to fix instance check
  • …and 159 more

Architecture

  • 0 containers · 1 bounded contexts · 0 dependency edges (baseline)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

bytedeco/storch was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 2dfa3884b9f0f2d1e2566aad791f44535b48bb09 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.