MCPcopy Create free account
hub / github.com/evilsocket/cake / get

Method get

cake-core/src/utils/fp8.rs:71–89  ·  view source on GitHub ↗
(
        &self,
        s: Shape,
        name: &str,
        _h: Init,
        dtype: DType,
        dev: &Device,
    )

Source from the content-addressed store, hash-verified

69
70impl SimpleBackend for Fp8Backend {
71 fn get(
72 &self,
73 s: Shape,
74 name: &str,
75 _h: Init,
76 dtype: DType,
77 dev: &Device,
78 ) -> candle_core::Result<Tensor> {
79 let tensor = self.load_tensor(name, dtype, dev)?;
80 if tensor.shape() != &s {
81 Err(candle_core::Error::UnexpectedShape {
82 msg: format!("shape mismatch for {name}"),
83 expected: s,
84 got: tensor.shape().clone(),
85 }
86 .bt())?
87 }
88 Ok(tensor)
89 }
90
91 fn get_unchecked(&self, name: &str, dtype: DType, dev: &Device) -> candle_core::Result<Tensor> {
92 self.load_tensor(name, dtype, dev)

Callers 15

find_cached_modelFunction · 0.45
ensure_model_downloadedFunction · 0.45
check_model_dirFunction · 0.45
split_modelFunction · 0.45
prefetch_safetensorsFunction · 0.45
from_index_jsonMethod · 0.45
read_tensorMethod · 0.45
read_tensorsMethod · 0.45

Calls 3

shapeMethod · 0.80
load_tensorMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected