TORCHMIX 🧩
GitHubGitHub (opens in a new tab)
  • Introduction
  • Component Class
  • Global Configurations
  • Config-only Mode
  • Examples
    • ViT
    • BERT
    • GPT
  • Components
    • Attention
    • WindowAttention
    • Feedforward
    • PositionalEmbedding
    • SinusoidalEmbedding
    • VocabEmbedding
    • PatchEmbedding
    • ClassEmbedding
    • AvgPool
    • ClassPool
    • PatchMerge
    • Add
    • Mul
    • Attach
    • Dropout
    • DropPath
    • StochasticDepth
    • PreNorm
    • PostNorm
    • Repeat
  • Plugins
    • CausalMask
    • DropAttention
    • DropProjection
    • RelativePositionBias
    • RelativePositionBiasViT
    • RotaryEmbedding
    • SubNorm
    • DropActivation
    • DropProjectionIn
    • DropProjectionOut
    • Transpose
  • Introduction
  • Component Class
  • Global Configurations
  • Config-only Mode
  • Examples
    • ViT
    • BERT
    • GPT
  • Components
    • Attention
    • WindowAttention
    • Feedforward
    • PositionalEmbedding
    • SinusoidalEmbedding
    • VocabEmbedding
    • PatchEmbedding
    • ClassEmbedding
    • AvgPool
    • ClassPool
    • PatchMerge
    • Add
    • Mul
    • Attach
    • Dropout
    • DropPath
    • StochasticDepth
    • PreNorm
    • PostNorm
    • Repeat
  • Plugins
    • CausalMask
    • DropAttention
    • DropProjection
    • RelativePositionBias
    • RelativePositionBiasViT
    • RotaryEmbedding
    • SubNorm
    • DropActivation
    • DropProjectionIn
    • DropProjectionOut
    • Transpose
Question? Give us feedback → (opens in a new tab)Edit this page
Config-only Mode

Config-only Mode

If you need Component objects only for configurations, you can use no_parameters context to suppress the creation of any parameters and only set the config attribute.

import torchmix
from torchmix import nn
 
with torchmix.no_parameters():
    nn.Linear(1000000, 1000000)  # Fast! ⚡ ️
Global ConfigurationsViT