leibniz 0.1.0

The package provides a differentiable vector graphics rasterization loss.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Polynomial roots.

pub mod linear;
pub mod quadratic;

use ::burn::tensor::{Tensor, backend::Backend};

const EPSILON: f32 = 1e-6;

type Values<B> = Tensor<B, 1>;

fn safe_divisor<B: Backend>(tensor: Values<B>) -> Values<B> {
    tensor
        .clone()
        .mask_fill(tensor.abs().lower_equal_elem(EPSILON), 1.0)
}