MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _GetNdArray

Method _GetNdArray

tensorflow/python/framework/test_util.py:2314–2323  ·  view source on GitHub ↗
(self, a)

Source from the content-addressed store, hash-verified

2312 self.assertTrue(self._NDArrayNear(ndarray1, ndarray2, err), msg=msg)
2313
2314 def _GetNdArray(self, a):
2315 # If a is a tensor then convert it to ndarray
2316 if isinstance(a, ops.Tensor):
2317 if isinstance(a, ops._EagerTensorBase):
2318 a = a.numpy()
2319 else:
2320 a = self.evaluate(a)
2321 if not isinstance(a, np.ndarray):
2322 return np.array(a)
2323 return a
2324
2325 def _assertArrayLikeAllClose(self, a, b, rtol=1e-6, atol=1e-6, msg=None):
2326 a = self._GetNdArray(a)

Callers 12

assertAllEqualMethod · 0.95
assertAllGreaterMethod · 0.95
assertAllLessMethod · 0.95
assertAllGreaterEqualMethod · 0.95
assertAllLessEqualMethod · 0.95
assertAllInRangeMethod · 0.95
assertAllInSetMethod · 0.95
assertDTypeEqualMethod · 0.95

Calls 2

evaluateMethod · 0.95
numpyMethod · 0.45

Tested by

no test coverage detected