Esempio n. 1
0
def tuple_equal(x, y):
    """Check tuples for equality.

    Args:
        x (tuple): First tuple.
        y (tuple): Second tuple.

    Returns:
        bool: `x` and `y` are equal.
    """
    return len(x) == len(y) and \
           all([B.shape(xi) == B.shape(yi) and B.all_bool(xi == yi)
                for xi, yi in zip(x, y)])
Esempio n. 2
0
 def __eq__(self, other):
     return B.all_bool(self.alpha == other.alpha)
Esempio n. 3
0
 def __eq__(self, other):
     return self[0] == other[0] and B.all_bool(self.period == other.period)
Esempio n. 4
0
 def __eq__(self, other):
     return B.all_bool(self.alpha == other.alpha) and \
            B.all_bool(self.beta == other.beta)
Esempio n. 5
0
 def __eq__(self, other):
     return B.all_bool(self.scale == other.scale) and self[0] == other[0]