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

Function test_cpu_backend_adaln_modulate

cake-core/src/backends/cpu/mod.rs:482–493  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

480
481 #[test]
482 fn test_cpu_backend_adaln_modulate() {
483 let backend = CpuBackend::new();
484 // (batch=1, seq=2, hidden=4)
485 let x = Tensor::randn(0f32, 1.0, (1, 2, 4), &Device::Cpu).unwrap();
486 let norm_weight = Tensor::ones(4, DType::F32, &Device::Cpu).unwrap();
487 let scale = Tensor::zeros((1, 2, 4), DType::F32, &Device::Cpu).unwrap();
488 let shift = Tensor::zeros((1, 2, 4), DType::F32, &Device::Cpu).unwrap();
489 let result = backend
490 .adaln_modulate(&x, &norm_weight, &scale, &shift, 1e-6)
491 .unwrap();
492 assert_eq!(result.dims(), &[1, 2, 4]);
493 }
494
495 #[test]
496 fn test_cpu_backend_rms_norm_gated() {

Callers

nothing calls this directly

Calls 1

adaln_modulateMethod · 0.45

Tested by

no test coverage detected