API Reference

creyone_layer.wrap.wrap_conv(cls, opt=None)[source]

Wrap a Conv Nd class with flexible argument parsing and optional behaviors.

Parameters:
  • cls (torch.nn.Conv2d) – A ConvNd-compatible class to wrap.

  • opt (set | str | None) – A ‘+’-separated string of option flags: - ‘grid’: use the kernel size arg as the stride (grid-like sampling). - ‘ap’: auto-pad so the output spatial size matches the input. - ‘dw’: set groups = in_channels (depthwise convolution).

Returns:

A factory function that accepts (c1, c2, k, …) positionally or as kwargs and forwards them to cls with stride, padding, dilation, and groups set.

creyone_layer.wrap.wrap_pool(cls, opt=None)[source]

Wrap a pooling class with flexible argument parsing and optional behaviors.

Parameters:
  • cls – A PoolNd-compatible class to wrap. Dilation is forwarded automatically only when the class supports it (MaxPoolNd does, AvgPoolNd does not).

  • opt (set | str | None) – A ‘+’-separated string of option flags: - ‘grid’: use the kernel size arg as the stride (grid-like sampling). - ‘ap’: auto-pad so the output spatial size matches the input. - ‘ar’: wrap output in AutoReshape for (B HW C) tensors.

Returns:

A factory function that accepts (k, …) positionally or as kwargs and forwards them to cls with stride, padding, and dilation set.

creyone_layer.utils.registry.layer_entrypoint(layer_name, layer_family=None, module_filter=None)[source]

Fetch a model entrypoint for specified model name

Parameters:
  • layer_name (str)

  • layer_family (str | None)

  • module_filter (str | None)

Return type:

Callable[[…], Any]