burn_tensor/tensor/grid/
mod.rs1mod affine_grid;
2mod meshgrid;
3
4pub use meshgrid::*;
5
6pub use affine_grid::*;
7
8#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)]
10pub enum GridIndexing {
11 #[default]
14 Matrix,
15
16 Cartesian,
19}
20
21#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)]
23pub enum GridSparsity {
24 #[default]
26 Dense,
27
28 Sparse,
30}
31
32#[derive(new, Default, Debug, Copy, Clone)]
34pub struct GridOptions {
35 pub indexing: GridIndexing,
37
38 pub sparsity: GridSparsity,
40}
41
42impl From<GridIndexing> for GridOptions {
43 fn from(value: GridIndexing) -> Self {
44 Self {
45 indexing: value,
46 ..Default::default()
47 }
48 }
49}
50impl From<GridSparsity> for GridOptions {
51 fn from(value: GridSparsity) -> Self {
52 Self {
53 sparsity: value,
54 ..Default::default()
55 }
56 }
57}
58
59#[derive(Default, Debug, Copy, Clone)]
61pub enum IndexPos {
62 #[default]
64 First,
65
66 Last,
68}