Trait ModuleDisplay

Source
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§

Source

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.

Source

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

Custom display settings for the module.

§Returns

An optional display settings object.

Source

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§

Source§

impl ModuleDisplay for bool

Source§

impl ModuleDisplay for f32

Source§

impl ModuleDisplay for f64

Source§

impl ModuleDisplay for i8

Source§

impl ModuleDisplay for i16

Source§

impl ModuleDisplay for i32

Source§

impl ModuleDisplay for i64

Source§

impl ModuleDisplay for isize

Source§

impl ModuleDisplay for str

Source§

impl ModuleDisplay for u8

Source§

impl ModuleDisplay for u16

Source§

impl ModuleDisplay for u32

Source§

impl ModuleDisplay for u64

Source§

impl ModuleDisplay for usize

Source§

impl ModuleDisplay for String

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl ModuleDisplay for Interpolate1d

Source§

impl ModuleDisplay for Interpolate2d

Source§

impl ModuleDisplay for HuberLoss

Source§

impl ModuleDisplay for MseLoss

Source§

impl ModuleDisplay for PoissonNllLoss

Source§

impl ModuleDisplay for AdaptiveAvgPool1d

Source§

impl ModuleDisplay for AdaptiveAvgPool2d

Source§

impl ModuleDisplay for AvgPool1d

Source§

impl ModuleDisplay for AvgPool2d

Source§

impl ModuleDisplay for MaxPool1d

Source§

impl ModuleDisplay for MaxPool2d

Source§

impl ModuleDisplay for Dropout

Source§

impl ModuleDisplay for Gelu

Source§

impl ModuleDisplay for HardSigmoid

Source§

impl ModuleDisplay for LeakyRelu

Source§

impl ModuleDisplay for Relu

Source§

impl ModuleDisplay for Sigmoid

Source§

impl ModuleDisplay for Tanh

Source§

impl ModuleDisplay for Unfold4d

Source§

impl ModuleDisplay for bf16

Source§

impl ModuleDisplay for f16

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<V> ModuleDisplay for RunningState<V>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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