netcrate!() { /* proc-macro */ }
Expand description

API for netcrate authors.

Usage

#![cfg_attr(not(feature = "std"), no_std)]
const_cge::netcrate!(ocr = "optical_char_recog.cge");

End users can use your network like:

use const_cge::ocr;
#[network(ocr)]
struct SomeEndUserStruct;
  • and choose their own numeric_type,
  • and their own floating point backend (std, libm, micromath, etc)

Your job may be finished, go rest.

Specifying Path

The path you provide is relative to the crate root (e.g. a crate file inside src would look like src/my_net.cge).

Multiple Networks

Unfortunately, you cannot use the module system to organize networks for users, they will all be forcibly hoisted to the top level.

const_cge::netcrate!(ocr          = "ocr.cge");
const_cge::netcrate!(denoise      = "denoise.cge");
const_cge::netcrate!(cart_pole    = "cart.cge");   
const_cge::netcrate!(octopus_legs = "octopus.cge");

Now, end users can use your network like:

#[network(network_zoo::ocr, numeric_type = f32)]
struct HandwritingOCR;