From 18874dfce172d63d2a2b7db525eed669bf6567df Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Fri, 23 Oct 2020 09:36:47 -0700 Subject: [PATCH] Update the docstring of linspace to make value increments computation easier to read. PiperOrigin-RevId: 338689844 Change-Id: I302f64fa46969f02ecbfcc434c937ecddfd3a5d1 --- tensorflow/python/ops/math_ops.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/ops/math_ops.py b/tensorflow/python/ops/math_ops.py index c493cec7e89..acaaf9c5bcc 100644 --- a/tensorflow/python/ops/math_ops.py +++ b/tensorflow/python/ops/math_ops.py @@ -114,8 +114,9 @@ def linspace_nd(start, stop, num, name=None, axis=0): A sequence of `num` evenly-spaced values are generated beginning at `start` along a given `axis`. - If `num > 1`, the values in the sequence increase by `stop - start / num - 1`, - so that the last one is exactly `stop`. If `num <= 0`, `ValueError` is raised. + If `num > 1`, the values in the sequence increase by + `(stop - start) / (num - 1)`, so that the last one is exactly `stop`. + If `num <= 0`, `ValueError` is raised. Matches [np.linspace](https://docs.scipy.org/doc/numpy/reference/generated/numpy.linspace.html)'s