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

Method testTop3

tensorflow/python/kernel_tests/topk_op_test.py:104–109  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

102 self._validateTopK(inputs, 2, [[0.4, 0.3], [0.4, 0.3]], [[3, 1], [2, 1]])
103
104 def testTop3(self):
105 k = 5
106 inputs = np.random.permutation(np.linspace(0, 100, 6140, dtype=np.float64))
107 indices = np.argsort(-inputs)[:k]
108 values = -np.sort(-inputs)[:k]
109 self._validateTopK(inputs, k, values, indices)
110
111 def testTop1AllNan(self):
112 inputs = [[np.NaN, np.NaN], [np.NaN, np.NaN]]

Callers

nothing calls this directly

Calls 3

_validateTopKMethod · 0.95
permutationMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected