GS::MASt3R::Encoder
MASt3R encoder: processes image pair with shared ViT + cross-attention
Constructors
new(config : EncoderConfig, device : Tensor::Device = Tensor::Device::GPU)
SourceInstance methods
blocks
Sourceconfig
Sourceforward_pair(x1 : Autograd::Variable, x2 : Autograd::Variable) : Tuple(Autograd::Variable, Autograd::Variable)
Encode image pair with cross-attention x1, x2: [batch, channels, height, width] Returns: tuple of [batch, num_patches + 1, embed_dim] for each image
forward_single(x : Autograd::Variable) : Autograd::Variable
Encode single image x: [batch, channels, height, width] Returns: [batch, num_patches + 1, embed_dim]
Load weights from safetensors
norm
Sourceparameters
Sourcepatch_embed
Sourcepos_embed
Source