zyx-derive

Crates.iozyx-derive
lib.rszyx-derive
version0.1.1
sourcesrc
created_at2024-03-09 17:02:33.208351
updated_at2024-03-21 16:35:49.320918
descriptionZyx procedural macros
homepagehttps://github.com/zk4x/zyx
repositoryhttps://github.com/zk4x/zyx
max_upload_size
id1167975
size8,112
(zk4x)

documentation

https://docs.rs/zyx-derive

README

zyx-derive

This crate contains procedural macros for zyx.

Macro Module automatically implements IntoIterator<Item = &Tensor> for your module, so that you can use it in backpropagation and save it to disk.

use zyx_core::backend::Backend;
use zyx_core::tensor::Tensor;

#[derive(Module)]
struct MyNet<B: Backend> {
    b: Tensor<B>,
    w: Tensor<B>,
}

impl<B: Backend> MyNet<B> {
    fn forward(&self, x: &Tensor<B>) -> Tensor<B> {
        x.dot(self.w) + self.b
    }
}

For README and source code, please visit github.

For more details, there is a book.

Features

  • std - enables zyx-core/std
Commit count: 493

cargo fmt