[package]
authors = ["nathanielsimard <nathaniel.simard.42@gmail.com>"]
categories = ["science", "no-std", "embedded", "wasm"]
description = "Tensor library with user-friendly APIs and automatic differentiation support"
documentation = "https://docs.rs/burn-tensor"
edition.workspace = true
keywords = ["deep-learning", "machine-learning", "tensor", "pytorch", "ndarray"]
license.workspace = true
name = "burn-tensor"
readme.workspace = true
repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-tensor"
version.workspace = true

[lints]
workspace = true

[features]
default = ["std", "burn-dispatch/default"]
doc = ["default"]
std = [
    "num-traits/std",
    "burn-std/std",
    "burn-backend/std",
    "burn-dispatch/std",
    "colored",
]
tracing = ["burn-std/tracing", "burn-backend/tracing", "burn-dispatch/tracing"]
distributed = ["std", "burn-backend/distributed", "burn-dispatch/distributed"]

cubecl = ["burn-backend/cubecl"]
cubecl-cuda = ["burn-backend/cubecl-cuda"]
cubecl-hip = ["burn-backend/cubecl-hip"]
cubecl-wgpu = ["burn-backend/cubecl-wgpu"]
cubecl-metal = ["burn-backend/cubecl-metal"]
cubecl-vulkan = ["burn-backend/cubecl-vulkan"]
cubecl-webgpu = ["burn-backend/cubecl-webgpu"]
cubecl-cpu = ["burn-backend/cubecl-cpu"]

# Backends
cuda = ["burn-dispatch/cuda", "cubecl-cuda"]
rocm = ["burn-dispatch/rocm", "cubecl-hip"]
flex = ["burn-dispatch/flex"]
ndarray = ["burn-dispatch/ndarray"]
tch = ["burn-dispatch/tch"]
wgpu = ["burn-dispatch/wgpu", "cubecl-wgpu"]
vulkan = ["wgpu", "burn-dispatch/vulkan", "cubecl-vulkan"]
webgpu = ["wgpu", "burn-dispatch/webgpu", "cubecl-webgpu"]
metal = ["wgpu", "burn-dispatch/metal", "cubecl-metal"]
cpu = ["burn-dispatch/cpu", "cubecl-cpu"]
autodiff = ["burn-dispatch/autodiff"]
remote = ["std", "burn-dispatch/remote"]
server = ["remote", "burn-dispatch/remote-server"]

# For backend extensions
extension = []

# Backend features
autotune = ["burn-dispatch/autotune"]
autotune-checks = ["burn-dispatch/autotune-checks"]
fusion = ["burn-dispatch/fusion"]

[dependencies]
burn-std = { workspace = true }
burn-backend = { workspace = true }
burn-dispatch = { workspace = true }
burn-backend-extension = { workspace = true, optional = true }

colored = { workspace = true, optional = true }
derive-new = { workspace = true }
num-traits = { workspace = true }

# Serialization
serde = { workspace = true }
enumset = { workspace = true }

[package.metadata.docs.rs]
features = ["doc"]
rustdoc-args = ["--cfg", "docsrs", "--html-in-header", "katex-header.html"]
