Beispiel #1
0
 def check_invariants(actual_provenance):
     C._dispatch_check_invariants(name)
     # Normalize the test namespace so that expected outputs are stable
     actual = C._dispatch_dump("{}::{}".format(
         test_namespace, name)).replace(test_namespace, "test")
     expected, expected_provenance = results.setdefault(
         frozenset(active_ops), (actual, actual_provenance))
     self.assertMultiLineEqual(
         expected, actual, "expected from {}; actual from {}".format(
             expected_provenance, actual_provenance))
 def __init__(self):
     C._dispatch_check_invariants(self.name)  # type: ignore[attr-defined]
     self.ref = C._dispatch_library("FRAGMENT", self.namespace,
                                    "")  # type: ignore[attr-defined]
     self.ref.def_("foo(Tensor x) -> Tensor")