Lantern icon indicating copy to clipboard operation
Lantern copied to clipboard

Clean up

Open dan-zheng opened this issue 6 years ago • 1 comments

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 or Typ consistently. Typ is not native for our version of LMS.
  • [ ] Improve testing.
    • [ ] Currently, all tests roughly look like this:
        test("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")
        }
      
      This is not ideal because the Rep[String] argument is never used. Can we make this nicer (does DslDriverC[Unit, Unit] work)?
    • [x] Done. Create a helper test utility class (e.g. LanternTestSuite) that extends org.scalatest.FunSuite. This class can define helpers like def runTest(snippet: DslDriverC[String, Unit]).
  • [x] Done. Rename files.
    • The filenames ad_lms.scala and ad_lms_vector.scala aren't very clear to me. Perhaps ScalarDifferentiation.scala and TensorDifferentiation.scala are more clear.
    • Pascal case all filenames.

For the most part, these items are low priority. We can pursue them lazily.

dan-zheng avatar Oct 05 '18 03:10 dan-zheng

I am not sure how to add an item to the list:

  • [x] be consistent with usage Manifest or Typ. Typ is not native for the version of LMS we are using.

GSAir avatar Oct 09 '18 18:10 GSAir