Documentation

SSA.Projects.Tensor1D.Tensor1D

@[reducible, inline]

Type of tensor dimensions and indexes into tensor dimensions. NOTE: see interaction with linarith where we need to unfold Index into https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Ergonomics.3A.20linarith.20does.20not.20work.20on.20Nat.20alias/near/365631549

Equations
Instances For
    structure Tensor1D.Tensor1d (α : Type) [Inhabited α] :
    Instances For
      theorem Tensor1D.Tensor1d.spec {α : Type} [Inhabited α] (self : Tensor1D.Tensor1d α) (ix : Tensor1D.Index) :
      ix self.sizeself.val ix = default
      Equations
      • Tensor1D.Tensor1d.empty = { size := 0, val := fun (x : Tensor1D.Index) => default, spec := }
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Tensor1D.Tensor1d.map {α : Type} [Inhabited α] (f : αα) (t : Tensor1D.Tensor1d α) :
          Equations
          Instances For
            theorem Tensor1D.Tensor1d.extract_map {α : Type} {f : αα} [Inhabited α] (t : Tensor1D.Tensor1d α) (left : Tensor1D.Index) (len : Tensor1D.Index) :
            Tensor1D.Tensor1d.map f (t.extract left len) = (Tensor1D.Tensor1d.map f t).extract left len
            Equations
            • t.fill v = { size := t.size, val := fun (ix : Tensor1D.Index) => if ix < t.size then v else default, spec := }
            Instances For
              theorem Tensor1D.Tensor1d.extract_fill {α : Type} {left : Tensor1D.Index} {len : Tensor1D.Index} {v : α} [Inhabited α] (t : Tensor1D.Tensor1d α) :
              (t.extract left len).fill v = (t.fill v).extract left len
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem Tensor1D.not_lt_is_geq {a : } {b : } (NOT_LT : ¬a < b) :
                a b
                theorem Tensor1D.extractslice_insertslice {α : Type} [Inhabited α] (t : Tensor1D.Tensor1d α) (sliceix : ) (slice : Tensor1D.Tensor1d α) (CORRECT : ((t.insertslice sliceix slice).extract sliceix slice.size).size 0) :
                (t.insertslice sliceix slice).extract sliceix slice.size = slice
                structure Tensor1D.Tensor2d (α : Type) :
                • size0 :
                • size1 :
                • val : Fin self.size0Fin self.size1α
                Instances For
                  Equations
                  • t.transpose = { size0 := t.size1, size1 := t.size0, val := fun (ix0 : Fin t.size1) (ix1 : Fin t.size0) => t.val ix1 ix0 }
                  Instances For
                    theorem Tensor1D.Tensor2d.transpose_involutive {α : Type} (t : Tensor1D.Tensor2d α) :
                    t.transpose.transpose = t
                    def Tensor1D.scf.for.loop {β : Sort u_1} (f : ββ) (n : ) (n_minus_i : ) (acc : β) :
                    β
                    Equations
                    Instances For
                      def Tensor1D.scf.for {β : Sort u_1} (n : ) (f : ββ) (seed : β) :
                      β
                      Equations
                      Instances For
                        theorem Tensor1D.scf.for.peel_begin {β : Sort u_1} (n : ) (f : ββ) (seed : β) :
                        Tensor1D.scf.for.loop f (n + 1) n (f 0 seed) = Tensor1D.scf.for.loop f (n + 1) (n + 1) seed
                        theorem Tensor1D.scf.for.peel_end {β : Sort u_1} (n : ) (f : ββ) (seed : β) :
                        Tensor1D.scf.for.loop f (n + 1) 0 (f n seed) = f n (Tensor1D.scf.for.loop f n 0 seed)
                        theorem Tensor1D.scf.for.zero_n {β : Sort u_1} (f : ββ) (seed : β) :
                        Tensor1D.scf.for 0 f seed = seed
                        def Tensor1D.scf.for.one_n {β : Sort u_1} (f : ββ) (seed : β) :
                        Tensor1D.scf.for 1 f seed = f 0 seed
                        Equations
                        • =
                        Instances For
                          inductive Tensor1D.Op :

                          We make the following simplifying assumptions in the IR:

                          • Currently, there is no way to build a tensor, we only have operations on them.
                          • Constants are only natural numbers, which represent indexing into tensors.
                          • 1D tensors are functions from indexes (natural) to tensor values (integers).

                          This matches the MLIR model, which has a separate index type for indexing and iXX/f32/f64 types for values held in tensors.

                          Instances For
                            inductive Tensor1D.Ty :
                            Instances For
                              Equations
                              Equations
                              • One or more equations did not get rendered due to their size.
                              @[reducible]
                              Equations
                              Instances For
                                Equations
                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.