Skip to main content

teeny_core/
lib.rs

1/*
2 * Copyright (c) 2026 Teenygrad.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *   http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17//! Foundation crate of [teenygrad](https://teenygrad.org): tensor/graph types, the computational
18//! graph ([`graph::Graph`]/[`graph::Op`]/[`graph::Shape`]), neural network layers ([`nn`]), the
19//! dtype system ([`dtype`]), device abstraction ([`device`]), and name-scoping used by every
20//! other `teeny-*` crate.
21//!
22//! `no_std` by default (the `std` feature is not in the default feature set) — enable `std` if
23//! you need it. See the crate README for the full feature list.
24
25#![cfg_attr(not(feature = "std"), no_std)]
26#![warn(missing_docs)]
27extern crate alloc;
28
29/// Compiler-facing traits (targets, compiled kernels).
30pub mod compiler;
31/// Device abstraction (buffers, contexts, launch configuration).
32pub mod device;
33/// The dtype system: `Dtype`/`Float`/tensor traits kernel code is generic over.
34pub mod dtype;
35/// Error types.
36pub mod errors;
37/// The computational graph: `Graph`, `Op`, `Shape`, `SymTensor`.
38pub mod graph;
39/// Internal macro helpers.
40pub mod macros;
41/// Model execution traits (`Layer`, lowering, kernel-launch argument packing).
42pub mod model;
43/// Scoped naming for graph nodes/parameters (requires the `std` feature).
44#[cfg(feature = "std")]
45pub mod name_scope;
46/// Standard neural network layers.
47pub mod nn;
48/// Runtime execution traits.
49pub mod runtime;
50/// Miscellaneous utilities (e.g. the `Dag` type).
51pub mod utils;