# tfl.kronecker_factored_lattice_lib.custom_reduce_prod

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/kronecker_factored_lattice_lib.py#L25-L70) |

tf.reduce_prod(t, axis) with faster custom gradient.

    tfl.kronecker_factored_lattice_lib.custom_reduce_prod(
        t, axis
    )

Shows comparable speed on CPU, up to 2x speed up on GPU, and 7x on TPU.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `t` | The tensor to reduce. |
| `axis` | The dimension to reduce. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| prod(t) and grad(prod(t)) ||

<br />