ass="sd">&quot;&quot;&quot;</span>
<span class="sd">    Function that implements :func:`torch.clamp` with a straight-through gradient estimator</span>
<span class="sd">    for the gradient of the output w.r.t. to ``x``, while the gradient of ``y`` w.r.t. to ``min_val``</span>
<span class="sd">    and ``max_val`` is always ``None``.</span>

<span class="sd">    Args:</span>
<span class="sd">        x: input tensor to clamp.</span>
<span class="sd">        min_val: scalar value to use as lower bound for the i