---
title: "snake"
sidebar_label: "snake"
description: "Kotlin binding reference: snake."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[snake](snake.md)

# snake

[common]\
fun [snake](snake.md)(input: [Tensor](../Tensor/index.md), alpha: [Tensor](../Tensor/index.md)? = null, beta: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0E-9): [Tensor](../Tensor/index.md)

`snake(input: Tensor, alpha: Tensor? = null, beta: Tensor? = null, eps: Double = 1e-9)`: the `snake` operator. Periodic &quot;snake&quot; activation (neural vocoders), per channels-last channel. `alpha` (frequency) and `beta` (magnitude) are rank-1 `[C]` tensors over `input`'s last dim, in the REAL domain. Apply `exp` once at setup for a log-scale checkpoint parameterization. `beta` absent selects the plain form (`beta = alpha`). One fused pass; the composed spelling costs five elementwise calls over the whole stream.