leibniz 0.2.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
//! Polynomial roots.

pub mod linear;
pub mod quadratic;

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

const EPSILON: f32 = 1e-6;

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