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

Method count_bits

tensorflow/python/ops/bitwise_ops_test.py:62–63  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

60 2**31 - 1, 2**31, 2**32 - 1, 2**32, -2**32 + 1, -2**32,
61 -2**63 + 1, 2**63 - 1]
62 def count_bits(x):
63 return sum(bin(z).count("1") for z in six.iterbytes(x.tobytes()))
64 for dtype in dtype_list:
65 with self.cached_session(use_gpu=True) as sess:
66 print("PopulationCount test: ", dtype)

Callers

nothing calls this directly

Calls 2

sumFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected