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

Method _testLargeTopK

tensorflow/python/kernel_tests/topk_op_test.py:128–136  ·  view source on GitHub ↗
(self, dtype)

Source from the content-addressed store, hash-verified

126 self._testLargeSort(np.float16)
127
128 def _testLargeTopK(self, dtype):
129 b = 10
130 n = 5000
131 k = n - 1
132 inputs = np.random.permutation(
133 np.linspace(0, 100, b * n, dtype=dtype)).reshape(b, n)
134 indices = np.argsort(-inputs, axis=1)[:, :k]
135 values = -np.sort(-inputs, axis=1)[:, :k]
136 self._validateTopK(inputs, k, values, indices)
137
138 def testLargeTopK(self):
139 self._testLargeTopK(np.float32)

Callers 1

testLargeTopKMethod · 0.95

Calls 4

_validateTopKMethod · 0.95
reshapeMethod · 0.80
permutationMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected