Expand description
Symbolic variables for dynamic tensor dimensions.
Variables allow tensor shapes to contain symbolic dimensions (e.g., batch size, sequence length) that are resolved to concrete values at execution time.
§Tinygrad Alignment
Matches Tinygrad’s Variable = UOp where Variable("i", 1, 10) creates
a DEFINE_VAR UOp and .bind(val) produces a BIND(DEFINE_VAR, CONST) UOp.
§Example
ⓘ
use svod_tensor::{Variable, Tensor};
use svod_dtype::DType;
let batch = Variable::new("batch", 1, 32);
let bound = batch.bind(16)?;
let mut x = Tensor::full_dynamic(&[bound.as_sint(), 784.into()], 0.0, DType::Float32)?;
x.realize()?;Structs§
- Bound
Variable - A variable bound to a concrete value.
- Variable
- A symbolic variable for dynamic tensor dimensions.