rockpool.nn.modules.from_nir

rockpool.nn.modules.from_nir(source: PathLike | NIRNode) Module[source]

Generate a rockpool model from a NIR representation

Parameters:

source (Union[PathLike, nir.NIRNode]) – Either a filename containing a NIR graph (produced with nir.write()), or an already-loaded NIR graph (e.g. loaded with nir.read())

Returns:

A torch-compatible Rockpool module converted from source

Return type:

torch.nn.Module