@@ -74,7 +74,7 @@ export class Ops {
7474 }
7575
7676 /**
77- * Creates rank-0 tensor (scalar) with the provided value and dtype.
77+ * Creates rank-0 `Tensor` (scalar) with the provided value and dtype.
7878 *
7979 * This method is mainly for self documentation and TypeScript typings as the
8080 * same functionality can be achieved with `tensor`. In general, we recommend
@@ -98,7 +98,7 @@ export class Ops {
9898 }
9999
100100 /**
101- * Creates rank-1 tensor with the provided values, shape and dtype.
101+ * Creates rank-1 `Tensor` with the provided values, shape and dtype.
102102 *
103103 * This method is mainly for self documentation and TypeScript typings as the
104104 * same functionality can be achieved with `tensor`. In general, we recommend
@@ -123,7 +123,7 @@ export class Ops {
123123 }
124124
125125 /**
126- * Creates rank-2 tensor with the provided values, shape and dtype.
126+ * Creates rank-2 `Tensor` with the provided values, shape and dtype.
127127 *
128128 * This method is mainly for self documentation and TypeScript typings as the
129129 * same functionality can be achieved with `tensor`. In general, we recommend
@@ -137,10 +137,11 @@ export class Ops {
137137 * // Pass a flat array and specify a shape.
138138 * dl.tensor2d([1, 2, 3, 4], [2, 2]).print();
139139 * ```
140+ *
140141 * @param values The values of the tensor. Can be nested array of numbers,
141142 * or a flat array, or a `TypedArray`.
142- * @param shape The shape of the tensor. Optional. If not provided,
143- * it is inferred from `values`.
143+ * @param shape The shape of the tensor. If not provided, it is inferred from
144+ * `values`.
144145 * @param dtype The data type.
145146 */
146147 @doc ( { heading : 'Tensors' , subheading : 'Creation' } )
@@ -158,7 +159,7 @@ export class Ops {
158159 }
159160
160161 /**
161- * Creates rank-3 tensor with the provided values, shape and dtype.
162+ * Creates rank-3 `Tensor` with the provided values, shape and dtype.
162163 *
163164 * This method is mainly for self documentation and TypeScript typings as
164165 * the same functionality can be achieved with `tensor`. In general, we
@@ -172,10 +173,11 @@ export class Ops {
172173 * // Pass a flat array and specify a shape.
173174 * dl.tensor3d([1, 2, 3, 4], [2, 2, 1]).print();
174175 * ```
176+ *
175177 * @param values The values of the tensor. Can be nested array of numbers,
176178 * or a flat array, or a `TypedArray`.
177- * @param shape The shape of the tensor. Optional. If not provided,
178- * it is inferred from `values`.
179+ * @param shape The shape of the tensor. If not provided, it is inferred from
180+ * `values`.
179181 * @param dtype The data type.
180182 */
181183 @doc ( { heading : 'Tensors' , subheading : 'Creation' } )
@@ -193,7 +195,7 @@ export class Ops {
193195 }
194196
195197 /**
196- * Creates rank-4 tensor with the provided values, shape and dtype.
198+ * Creates rank-4 `Tensor` with the provided values, shape and dtype.
197199 * ```js
198200 * // Pass a nested array.
199201 * dl.tensor4d([[[[1], [2]], [[3], [4]]]]).print();
@@ -202,6 +204,7 @@ export class Ops {
202204 * // Pass a flat array and specify a shape.
203205 * dl.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]).print();
204206 * ```
207+ *
205208 * @param values The values of the tensor. Can be nested array of numbers,
206209 * or a flat array, or a `TypedArray`.
207210 * @param shape The shape of the tensor. Optional. If not provided,
@@ -223,11 +226,11 @@ export class Ops {
223226 }
224227
225228 /**
226- * Creates a tensor with all elements set to 1.
229+ * Creates a `Tensor` with all elements set to 1.
227230 *
228231 * @param shape An array of integers defining the output tensor shape.
229- * @param dtype The type of an element in the resulting tensor. Can
230- * be 'float32', 'int32' or 'bool'. Defaults to 'float'.
232+ * @param dtype The type of an element in the resulting tensor. Defaults to
233+ * 'float'.
231234 */
232235 @doc ( { heading : 'Tensors' , subheading : 'Creation' } )
233236 @operation
@@ -238,7 +241,7 @@ export class Ops {
238241 }
239242
240243 /**
241- * Creates a tensor with all elements set to 0.
244+ * Creates a `Tensor` with all elements set to 0.
242245 * @param shape An array of integers defining the output tensor shape.
243246 * @param dtype The type of an element in the resulting tensor. Can
244247 * be 'float32', 'int32' or 'bool'. Defaults to 'float'.
@@ -252,11 +255,12 @@ export class Ops {
252255 }
253256
254257 /**
255- * Creates a tensor filled with a scalar value.
258+ * Creates a `Tensor` filled with a scalar value.
259+ *
256260 * @param shape An array of integers defining the output tensor shape.
257261 * @param value The scalar value to fill the tensor with.
258- * @param dtype The type of an element in the resulting tensor. Can
259- * be 'float32', 'int32' or 'bool'. Defaults to 'float'.
262+ * @param dtype The type of an element in the resulting tensor. Defaults to
263+ * 'float'.
260264 */
261265 @doc ( { heading : 'Tensors' , subheading : 'Creation' } )
262266 @operation
@@ -270,7 +274,7 @@ export class Ops {
270274 }
271275
272276 /**
273- * Creates a tensor with all elements set to 1 with the same shape as the
277+ * Creates a `Tensor` with all elements set to 1 with the same shape as the
274278 * given tensor.
275279 * @param x A tensor.
276280 */
@@ -281,8 +285,9 @@ export class Ops {
281285 }
282286
283287 /**
284- * Creates a tensor with all elements set to 0 with the same shape as the
288+ * Creates a `Tensor` with all elements set to 0 with the same shape as the
285289 * given tensor.
290+ *
286291 * @param x A tensor.
287292 */
288293 @doc ( { heading : 'Tensors' , subheading : 'Creation' } )
@@ -303,7 +308,8 @@ export class Ops {
303308 }
304309
305310 /**
306- * Creates a tensor with values sampled from a normal distribution.
311+ * Creates a `Tensor` with values sampled from a normal distribution.
312+ *
307313 * @param shape An array of integers defining the output tensor shape.
308314 * @param mean The mean of the normal distribution.
309315 * @param stdDev The standard deviation of the normal distribution.
@@ -324,7 +330,8 @@ export class Ops {
324330 }
325331
326332 /**
327- * Creates a tensor with values sampled from a truncated normal distribution.
333+ * Creates a `Tensor` with values sampled from a truncated normal
334+ * distribution.
328335 *
329336 * The generated values follow a normal distribution with specified mean and
330337 * standard deviation, except that values whose magnitude is more than 2
@@ -350,7 +357,7 @@ export class Ops {
350357 }
351358
352359 /**
353- * Creates a tensor with values sampled from a uniform distribution.
360+ * Creates a `Tensor` with values sampled from a uniform distribution.
354361 *
355362 * The generated values follow a uniform distribution in the range [minval,
356363 * maxval). The lower bound minval is included in the range, while the upper
@@ -372,7 +379,7 @@ export class Ops {
372379 }
373380
374381 /**
375- * Creates a tensor with values sampled from a random number generator
382+ * Creates a `Tensor` with values sampled from a random number generator
376383 * function defined by the user.
377384 *
378385 * @param shape An array of integers defining the output tensor shape.
@@ -404,7 +411,7 @@ export class Ops {
404411 }
405412
406413 /**
407- * Draws samples from a multinomial distribution.
414+ * Creates a `Tensor` with values drawn from a multinomial distribution.
408415 *
409416 * @param probabilities 1D array with normalized outcome probabilities, or
410417 * 2D array of shape `[batchSize, numOutcomes]`.
@@ -445,7 +452,7 @@ export class Ops {
445452 }
446453
447454 /**
448- * Creates a one-hot tensor . The locations represented by `indices` take
455+ * Creates a one-hot `Tensor` . The locations represented by `indices` take
449456 * value `onValue` (defaults to 1), while all other locations take value
450457 * `offValue` (defaults to 0).
451458 *
@@ -468,7 +475,7 @@ export class Ops {
468475 }
469476
470477 /**
471- * Creates a tensor from an image.
478+ * Creates a `Tensor` from an image.
472479 *
473480 * @param pixels The input image to construct the tensor from. Accepts image
474481 * of type `ImageData`, `HTMLImageElement`, `HTMLCanvasElement`, or
@@ -490,7 +497,7 @@ export class Ops {
490497 }
491498
492499 /**
493- * Reshapes a tensor to a given shape.
500+ * Reshapes a `Tensor` to a given shape.
494501 *
495502 * Given a input tensor, returns a new tensor with the same values as the
496503 * input tensor with shape `shape`.
@@ -504,6 +511,7 @@ export class Ops {
504511 * shape filled with the values of tensor. In this case, the number of
505512 * elements implied by shape must be the same as the number of elements in
506513 * tensor.
514+ *
507515 * @param x A tensor.
508516 * @param shape An array of integers defining the output tensor shape.
509517 */
@@ -638,13 +646,10 @@ export class Ops {
638646 /**
639647 * Return an evenly spaced sequence of numbers over the given interval.
640648 *
641- * The stop value can be optionally excluded by passing setting [endpoint] to
642- * true.
643- *
644649 * @param start The start value of the sequence
645650 * @param stop The end value of the sequence
646651 * @param num The number of values to generate
647- * @param endpoint Optional, determines whether stop is included in the
652+ * @param endpoint Determines whether stop is included in the
648653 * sequence. Defaults to true.
649654 */
650655 @operation
@@ -666,16 +671,16 @@ export class Ops {
666671 }
667672
668673 /**
669- * Creates a new Tensor1D filled with the numbers in the range provided.
674+ * Creates a new ` Tensor1D` filled with the numbers in the range provided.
670675 *
671676 * The tensor is a is half-open interval meaning it includes start, but
672677 * excludes stop. Decrementing ranges and negative step values are also
673678 * supported.
674679 *
675680 * @param start An integer start value
676681 * @param stop An integer stop value
677- * @param step An optional integer increment (will default to 1 or -1)
678- * @param dtype An optional dtype
682+ * @param step An integer increment (will default to 1 or -1)
683+ * @param dtype
679684 */
680685 @operation
681686 @doc ( { heading : 'Tensors' , subheading : 'Creation' } )
0 commit comments