def score(key: DeviceProperties, other: DeviceProperties) -> int:
        """
        Returns score indicating how similar two instances of the `Properties` tuple are. Points are calculated using
        bits, but documented as int. Rules are as follows:
            * Matching `type` gives 8 points.
            * Semi-matching `type`, for example cuda and rocm, gives 4 points.
            * Matching `major` (compute capability major version) gives 2 points.
            * Default expectation (if present) gives 1 points.
        """
        (device_type, major) = key
        (other_device_type, other_major) = other

        score = 0b0
        if device_type == other_device_type:
            score |= 0b1000
        elif device_type in ["cuda", "rocm"] and other_device_type in ["cuda", "rocm"]:
            score |= 0b100

        if major == other_major and other_major is not None:
            score |= 0b10

        if Expectations.is_default(other):
            score |= 0b1

        return int(score)

        Returns score indicating how similar two instances of the `Properties` tuple are. Points are calculated using
        bits, but documented as int. Rules are as follows:
            * Matching `type` gives 8 points.
            * Semi-matching `type`, for example cuda and rocm, gives 4 points.
            * Matching `major` (compute capability major version) gives 2 points.
            * Default expectation (if present) gives 1 points.
        
src/diffusers/utils/testing_utils.py