MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / _equal

Method _equal

python/ctranslate2/specs/model_spec.py:707–715  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

705 return self
706
707 def _equal(self, other) -> bool:
708 a = self.array
709 b = other.array
710 return a is b or (
711 a.dtype == b.dtype
712 and a.shape == b.shape
713 and a.flat[0] == b.flat[0]
714 and np.array_equal(a, b)
715 )
716
717
718class PyTorchVariable(Variable):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected