So we are now invoking it, passing in the "self", the guard itself,
in.
The signature is: "def EQUALS_MATCH(self, guard: Guard):"
And internally to that function, we can use the "name" on the guard to
get back our original object, querying it for data and type
information, which in turn gets us to the most important bit:
appending code.
At its simplest, "EQUALS_MATCH" appends just one line of code:
"self.code.append(f"{ref} == {val!r}")". Where "ref" is the name of
the variable, and "val" is the value. It might produce code like this:
y == 2
This is a basic example. But if we append a few other kinds of
"GuardBuilder" functions and then combine them all with "and" in
between each statement (as we do), we might get something like this:
guardedcode.valid and _check_type_id(y, 94367738391392) and y == 2 and ___check_tensors(x)
Here is what this code performs:


A check for ".valid"


A type ID check


A value check


A tensor check

