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

Method silu_mul

cake-core/src/backends/vulkan/mod.rs:1287–1296  ·  view source on GitHub ↗
(&self, gate: &Tensor, up: &Tensor)

Source from the content-addressed store, hash-verified

1285 }
1286
1287 fn silu_mul(&self, gate: &Tensor, up: &Tensor) -> Result<Tensor> {
1288 let n = gate.elem_count();
1289 if n > 32768 {
1290 log::debug!("silu_mul GPU: {n} elements");
1291 self.dispatch_binary_vec4(gate, up, "silu_mul")
1292 } else {
1293 log::debug!("silu_mul CPU: {n} elements (<=32768)");
1294 (candle_nn::ops::silu(&gate.contiguous()?)? * up.contiguous()?)?.contiguous()
1295 }
1296 }
1297
1298 fn stable_softplus(&self, x: &Tensor) -> Result<Tensor> {
1299 let n = x.elem_count();

Callers

nothing calls this directly

Calls 2

siluFunction · 0.85
dispatch_binary_vec4Method · 0.80

Tested by

no test coverage detected