MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / __eq__

Method __eq__

bitsandbytes/functional.py:589–610  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

587 self.state2.code = self.state2.code.to(device)
588
589 def __eq__(self, other):
590 if not isinstance(other, QuantState):
591 return False
592
593 return (
594 torch.allclose(self.absmax, other.absmax, atol=1e-6)
595 and self.shape == other.shape
596 and torch.allclose(self.code, other.code, atol=1e-6)
597 and self.dtype == other.dtype
598 and self.blocksize == other.blocksize
599 and self.quant_type == other.quant_type
600 and (
601 self.offset == other.offset
602 if self.offset is not None and other.offset is not None
603 else self.offset is other.offset
604 )
605 and (
606 self.state2 == other.state2
607 if self.state2 is not None and other.state2 is not None
608 else self.state2 is other.state2
609 )
610 )
611
612
613def quantize_blockwise(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected