<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: yes</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: debian 9 (stretch)</li>
<li><strong>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device</strong>: n/a</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: binary</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.9.0</li>
<li><strong>Python version</strong>: 3.6</li>
<li><strong>Bazel version (if compiling from source)</strong>: n/a</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: n/a</li>
<li><strong>CUDA/cuDNN version</strong>: n/a</li>
<li><strong>GPU model and memory</strong>: n/a</li>
<li><strong>Exact command to reproduce</strong>: see below (short version: <code class="notranslate">N=int(1e4); assert len(tf.unique(tf.distributions.Uniform().sample(N)).y.eval()) == N</code>)</li>
</ul>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">Traced subtle bug in my code back to the fact that the TF Uniform distribution (maybe others?) does not produce unique samples.. This is bad.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="N = int(1e4)

len(np.unique(np.random.rand(N))) # 10000

tf.InteractiveSession()
len(tf.unique(tf.distributions.Uniform().sample(N)).y.eval()) # 9993"><pre class="notranslate"><code class="notranslate">N = int(1e4)

len(np.unique(np.random.rand(N))) # 10000

tf.InteractiveSession()
len(tf.unique(tf.distributions.Uniform().sample(N)).y.eval()) # 9993
</code></pre></div>
<p dir="auto">bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package</p>
<p dir="auto">Warning: ignoring LD_PRELOAD in environment.<br>
ERROR: /home/wenjian/pkgs/tensorflow/tensorflow/core/distributed_runtime/rpc/BUILD:87:1: no such package '@grpc//': Error cloning repository: <a href="https://boringssl.googlesource.com/boringssl" rel="nofollow">https://boringssl.googlesource.com/boringssl</a>: cannot open git-upload-pack caused by <a href="https://boringssl.googlesource.com/boringssl" rel="nofollow">https://boringssl.googlesource.com/boringssl</a>: cannot open git-upload-pack caused by <a href="https://boringssl.googlesource.com/boringssl" rel="nofollow">https://boringssl.googlesource.com/boringssl</a>: cannot open git-upload-pack and referenced by '//tensorflow/core/distributed_runtime/rpc:grpc_channel'.<br>
ERROR: Loading failed; build aborted.<br>
INFO: Elapsed time: 342.460s</p>