Trait burn::module::ModuleDisplay

pub trait ModuleDisplay: ModuleDisplayDefault {
    // Provided methods
    fn format(&self, passed_settings: DisplaySettings) -> String { ... }
    fn custom_settings(&self) -> Option<DisplaySettings> { ... }
    fn custom_content(&self, _content: Content) -> Option<Content> { ... }
}
Expand description

Trait to implement custom display settings for a module.

In order to implement custom display settings for a module,

  1. Add #[module(custom_display)] attribute to the module struct after #[derive(Module)]
  2. Implement ModuleDisplay trait for the module

Provided Methods§

fn format(&self, passed_settings: DisplaySettings) -> String

Formats the module with provided display settings.

§Arguments
  • passed_settings - Display settings passed to the module.
§Returns

A string representation of the formatted module.

fn custom_settings(&self) -> Option<DisplaySettings>

Custom display settings for the module.

§Returns

An optional display settings object.

fn custom_content(&self, _content: Content) -> Option<Content>

Custom attributes for the module.

§Arguments
  • _content - The content object that contains display settings and attributes.
§Returns

An optional content object containing the custom attributes.

Implementations on Foreign Types§

§

impl ModuleDisplay for bool

§

impl ModuleDisplay for f32

§

impl ModuleDisplay for f64

§

impl ModuleDisplay for i8

§

impl ModuleDisplay for i16

§

impl ModuleDisplay for i32

§

impl ModuleDisplay for i64

§

impl ModuleDisplay for str

§

impl ModuleDisplay for u8

§

impl ModuleDisplay for u16

§

impl ModuleDisplay for u32

§

impl ModuleDisplay for u64

§

impl ModuleDisplay for usize

§

impl ModuleDisplay for String

§

impl<B> ModuleDisplay for PhantomData<B>
where B: Backend,

§

impl<L0, L1> ModuleDisplay for (L0, L1)

§

impl<L0, L1, L2> ModuleDisplay for (L0, L1, L2)

§

impl<L0, L1, L2, L3> ModuleDisplay for (L0, L1, L2, L3)

§

impl<L0, L1, L2, L3, L4> ModuleDisplay for (L0, L1, L2, L3, L4)

§

impl<L0, L1, L2, L3, L4, L5> ModuleDisplay for (L0, L1, L2, L3, L4, L5)

§

impl<L0, L1, L2, L3, L4, L5, L6> ModuleDisplay for (L0, L1, L2, L3, L4, L5, L6)

§

impl<L0, L1, L2, L3, L4, L5, L6, L7> ModuleDisplay for (L0, L1, L2, L3, L4, L5, L6, L7)

§

impl<L0, L1, L2, L3, L4, L5, L6, L7, L8> ModuleDisplay for (L0, L1, L2, L3, L4, L5, L6, L7, L8)

§

impl<L0, L1, L2, L3, L4, L5, L6, L7, L8, L9> ModuleDisplay for (L0, L1, L2, L3, L4, L5, L6, L7, L8, L9)

§

impl<T> ModuleDisplay for Option<T>
where T: ModuleDisplay,

§

impl<T> ModuleDisplay for Vec<T>
where T: ModuleDisplay,

§

impl<const N: usize, T> ModuleDisplay for [T; N]
where T: ModuleDisplay,

Implementors§

§

impl ModuleDisplay for Interpolate1d

§

impl ModuleDisplay for Interpolate2d

§

impl ModuleDisplay for HuberLoss

§

impl ModuleDisplay for MseLoss

§

impl ModuleDisplay for AdaptiveAvgPool1d

§

impl ModuleDisplay for AdaptiveAvgPool2d

§

impl ModuleDisplay for AvgPool1d

§

impl ModuleDisplay for AvgPool2d

§

impl ModuleDisplay for MaxPool1d

§

impl ModuleDisplay for MaxPool2d

§

impl ModuleDisplay for Dropout

§

impl ModuleDisplay for Gelu

§

impl ModuleDisplay for HardSigmoid

§

impl ModuleDisplay for LeakyRelu

§

impl ModuleDisplay for Relu

§

impl ModuleDisplay for Sigmoid

§

impl ModuleDisplay for Tanh

§

impl ModuleDisplay for Unfold4d

§

impl ModuleDisplay for bf16

§

impl ModuleDisplay for f16

§

impl<B> ModuleDisplay for MultiHeadAttention<B>
where B: Backend,

§

impl<B> ModuleDisplay for Conv1d<B>
where B: Backend,

§

impl<B> ModuleDisplay for Conv2d<B>
where B: Backend,

§

impl<B> ModuleDisplay for Conv3d<B>
where B: Backend,

§

impl<B> ModuleDisplay for ConvTranspose1d<B>
where B: Backend,

§

impl<B> ModuleDisplay for ConvTranspose2d<B>
where B: Backend,

§

impl<B> ModuleDisplay for ConvTranspose3d<B>
where B: Backend,

§

impl<B> ModuleDisplay for DeformConv2d<B>
where B: Backend,

§

impl<B> ModuleDisplay for Gru<B>
where B: Backend,

§

impl<B> ModuleDisplay for BinaryCrossEntropyLoss<B>
where B: Backend,

§

impl<B> ModuleDisplay for CrossEntropyLoss<B>
where B: Backend,

§

impl<B> ModuleDisplay for BiLstm<B>
where B: Backend,

§

impl<B> ModuleDisplay for Embedding<B>
where B: Backend,

§

impl<B> ModuleDisplay for GateController<B>
where B: Backend,

§

impl<B> ModuleDisplay for GroupNorm<B>
where B: Backend,

§

impl<B> ModuleDisplay for InstanceNorm<B>
where B: Backend,

§

impl<B> ModuleDisplay for LayerNorm<B>
where B: Backend,

§

impl<B> ModuleDisplay for Linear<B>
where B: Backend,

§

impl<B> ModuleDisplay for Lstm<B>
where B: Backend,

§

impl<B> ModuleDisplay for PRelu<B>
where B: Backend,

§

impl<B> ModuleDisplay for PositionalEncoding<B>
where B: Backend,

§

impl<B> ModuleDisplay for RmsNorm<B>
where B: Backend,

§

impl<B> ModuleDisplay for RotaryEncoding<B>
where B: Backend,

§

impl<B> ModuleDisplay for SwiGlu<B>
where B: Backend,

§

impl<B> ModuleDisplay for PositionWiseFeedForward<B>
where B: Backend,

§

impl<B> ModuleDisplay for TransformerDecoder<B>
where B: Backend,

§

impl<B> ModuleDisplay for TransformerDecoderLayer<B>
where B: Backend,

§

impl<B> ModuleDisplay for TransformerEncoder<B>
where B: Backend,

§

impl<B> ModuleDisplay for TransformerEncoderLayer<B>
where B: Backend,

§

impl<T> ModuleDisplay for Ignored<T>
where T: Sync + Send + Debug + Clone,

§

impl<V> ModuleDisplay for RunningState<V>

§

impl<const D: usize, B> ModuleDisplay for BatchNorm<B, D>
where B: Backend,

§

impl<const D: usize, B> ModuleDisplay for Param<Tensor<B, D>>
where B: Backend,

§

impl<const D: usize, B> ModuleDisplay for Param<Tensor<B, D, Bool>>
where B: Backend,

§

impl<const D: usize, B> ModuleDisplay for Param<Tensor<B, D, Int>>
where B: Backend,

§

impl<const D: usize, B, K> ModuleDisplay for Tensor<B, D, K>
where B: Backend, K: BasicOps<B>,