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

Method sub_mul

cake-core/src/backends/vulkan/mod.rs:1334–1343  ·  view source on GitHub ↗
(&self, a: &Tensor, b: &Tensor, c: &Tensor)

Source from the content-addressed store, hash-verified

1332 }
1333
1334 fn sub_mul(&self, a: &Tensor, b: &Tensor, c: &Tensor) -> Result<Tensor> {
1335 let n = a.elem_count();
1336 if n > 32768 {
1337 log::debug!("sub_mul GPU: {n} elements");
1338 self.dispatch_ternary_vec4(a, b, c, "sub_mul")
1339 } else {
1340 log::debug!("sub_mul CPU: {n} elements (<=32768)");
1341 ((a - b)? * c)?.contiguous()
1342 }
1343 }
1344
1345 fn preprocess_linear_weight(&self, weight: &Tensor) -> Result<Tensor> {
1346 // Pre-upload F32 version to GPU cache (tensor_matmul will find it via get_or_upload).

Callers

nothing calls this directly

Calls 1

dispatch_ternary_vec4Method · 0.80

Tested by

no test coverage detected