File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -323,18 +323,20 @@ def tree_full_like(
323
323
324
324
def tree_clip (
325
325
tree : Any ,
326
- min_value : Optional [jax .typing .ArrayLike ],
327
- max_value : Optional [jax .typing .ArrayLike ],
326
+ min_value : Optional [jax .typing .ArrayLike ] = None ,
327
+ max_value : Optional [jax .typing .ArrayLike ] = None ,
328
328
) -> Any :
329
329
"""Creates an identical tree where all tensors are clipped to `[min, max]`.
330
330
331
331
Args:
332
332
tree: pytree.
333
- min_value: min value to clip all tensors to.
334
- max_value: max value to clip all tensors to.
333
+ min_value: optional minimal value to clip all tensors to. If ``None``
334
+ (default) then result will not be clipped to any minimum value.
335
+ max_value: optional maximal value to clip all tensors to. If ``None``
336
+ (default) then result will not be clipped to any maximum value.
335
337
336
338
Returns:
337
- an tree with the same structure as ``tree``.
339
+ a tree with the same structure as ``tree``.
338
340
339
341
.. versionadded:: 0.2.3
340
342
"""
You can’t perform that action at this time.
0 commit comments