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

Method preprocess_linear_weight

cake-core/src/backends/rocm/mod.rs:359–363  ·  view source on GitHub ↗
(&self, weight: &Tensor)

Source from the content-addressed store, hash-verified

357 fn device(&self) -> &Device { &self.device }
358
359 fn preprocess_linear_weight(&self, weight: &Tensor) -> Result<Tensor> {
360 // Pre-ensure contiguous layout at load time to avoid runtime copies.
361 // Don't change dtype — linear_forward expects matching dtypes with input.
362 if weight.is_contiguous() { Ok(weight.clone()) } else { weight.contiguous() }
363 }
364
365 fn matmul(&self, a: &Tensor, b: &Tensor) -> Result<Tensor> {
366 let orig = a.dtype();

Callers 5

loadMethod · 0.45
loadMethod · 0.45
loadMethod · 0.45
load_customMethod · 0.45
loadMethod · 0.45

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected