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

Method get

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

Source from the content-addressed store, hash-verified

246
247impl SimpleBackend for GptqBackend {
248 fn get(
249 &self,
250 s: Shape,
251 name: &str,
252 _h: Init,
253 dtype: DType,
254 dev: &Device,
255 ) -> candle_core::Result<Tensor> {
256 let tensor = self.load_tensor(name, dtype, dev)?;
257 if tensor.shape() != &s {
258 Err(candle_core::Error::UnexpectedShape {
259 msg: format!("shape mismatch for {name}"),
260 expected: s,
261 got: tensor.shape().clone(),
262 }
263 .bt())?
264 }
265 Ok(tensor)
266 }
267
268 fn get_unchecked(&self, name: &str, dtype: DType, dev: &Device) -> candle_core::Result<Tensor> {
269 self.load_tensor(name, dtype, dev)

Callers 5

is_gptq_quantizedFunction · 0.45
gptq_group_sizeFunction · 0.45
dequantize_packed_4bitFunction · 0.45
load_tensorMethod · 0.45
contains_tensorMethod · 0.45

Calls 3

shapeMethod · 0.80
load_tensorMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected