mirror of
https://github.com/huggingface/candle.git
synced 2025-06-17 19:18:50 +00:00
Retrieve more information from PyTorch checkpoints. (#515)
* Retrieve more information from PyTorch checkpoints. * Add enough support to load dino-v2 backbone weights.
This commit is contained in:
@ -9,6 +9,14 @@ pub struct Layout {
|
||||
}
|
||||
|
||||
impl Layout {
|
||||
pub fn new(shape: Shape, stride: Vec<usize>, start_offset: usize) -> Self {
|
||||
Self {
|
||||
shape,
|
||||
stride,
|
||||
start_offset,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn contiguous_with_offset<S: Into<Shape>>(shape: S, start_offset: usize) -> Self {
|
||||
let shape = shape.into();
|
||||
let stride = shape.stride_contiguous();
|
||||
|
Reference in New Issue
Block a user