[PATCH] D139370: [mlgo] Dependency-free training mode logger

Jacob Hegna via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 14:55:23 PST 2022


jacobhegna accepted this revision.
jacobhegna added a comment.
This revision is now accepted and ready to land.

just some small python style nits



================
Comment at: llvm/lib/Analysis/models/log_reader.py:1
+import ctypes
+import dataclasses
----------------
nit: docstring for file


================
Comment at: llvm/lib/Analysis/models/log_reader.py:29
+  @staticmethod
+  def from_dict(d: dict):
+    name = d['name']
----------------
nit: could make this a `@classmethod`


================
Comment at: llvm/lib/Analysis/models/log_reader.py:50
+
+  def spec(self):
+    return self._spec
----------------
nit: return type annotations? same for next two methods


================
Comment at: llvm/lib/Analysis/models/log_reader.py:62
+
+def read_tensor(fs, ts: TensorSpec) -> TensorValue:
+  size = math.prod(ts.shape) * ctypes.sizeof(ts.element_type)
----------------
nit: annotate `fs`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139370/new/

https://reviews.llvm.org/D139370



More information about the llvm-commits mailing list