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

Method decode

cake-core/src/models/sd/vae.rs:124–135  ·  view source on GitHub ↗
(
        forwarder: &mut Box<dyn Forwarder>,
        latents: Tensor,
        ctx: &mut Context,
    )

Source from the content-addressed store, hash-verified

122 pub const LAYER_NAME: &'static str = "vae";
123
124 pub async fn decode(
125 forwarder: &mut Box<dyn Forwarder>,
126 latents: Tensor,
127 ctx: &mut Context,
128 ) -> anyhow::Result<Tensor> {
129 let tensors = Vec::from([Tensor::from_slice(&[0f32], 1, &ctx.device)?, latents]);
130
131 let combined_tensor = pack_tensors(tensors, &ctx.device)?;
132
133 let result = forwarder.forward_mut(&combined_tensor, 0, 0, ctx).await?;
134 Ok(result)
135 }
136}
137
138#[cfg(test)]

Callers 4

generate_speechFunction · 0.45
image_preprocessFunction · 0.45
forwardMethod · 0.45
next_tokenMethod · 0.45

Calls 2

pack_tensorsFunction · 0.85
forward_mutMethod · 0.45

Tested by

no test coverage detected