Lantern
Lantern copied to clipboard
Clean up
A big list of clean up opportunities, vaguely ordered by importance. Feel free to add/edit.
- [ ] Revamp tensor initializers, especially ones that take both "data" and "shape" arguments.
- "Data" arguments should be clearly distinguished from "shape" arguments.
-
Tensor.ones(2, 3)
is fine.Tensor.fill(1, 2, 3)
is not. - Use multiple parameter lists for disambiguation:
Tensor.fill(2, 3) { is => idx += 1; idx }
- [x] Done. Use either
Manifest
orTyp
consistently.Typ
is not native for our version of LMS. - [ ] Improve testing.
- [ ] Currently, all tests roughly look like this:
This is not ideal because thetest("foobar") { val test1 = new DslDriverC[String, Unit] with TensorExp { def snippet(a: Rep[String]): Rep[Unit] = { // `a` is a dummy that's not actually used. Tensor.assertEqual(...) } } test1.eval("a") }
Rep[String]
argument is never used. Can we make this nicer (doesDslDriverC[Unit, Unit]
work)? - [x] Done. Create a helper test utility class (e.g.
LanternTestSuite
) that extendsorg.scalatest.FunSuite
. This class can define helpers likedef runTest(snippet: DslDriverC[String, Unit])
.
- [ ] Currently, all tests roughly look like this:
- [x] Done. Rename files.
- The filenames
ad_lms.scala
andad_lms_vector.scala
aren't very clear to me. PerhapsScalarDifferentiation.scala
andTensorDifferentiation.scala
are more clear. - Pascal case all filenames.
- The filenames
For the most part, these items are low priority. We can pursue them lazily.
I am not sure how to add an item to the list:
- [x] be consistent with usage
Manifest
orTyp
.Typ
is not native for the version of LMS we are using.