From 8d594e32cad5c2d61f94266328d626ecb446b395 Mon Sep 17 00:00:00 2001 From: gaikwadrahul8 <115997457+gaikwadrahul8@users.noreply.github.com> Date: Fri, 11 Oct 2024 04:54:41 +0530 Subject: [PATCH] Fix typos in the documentation strings of the tfjs-core directory (#8413) --- tfjs-core/scripts/cloud_funcs/README.md | 4 ++-- tfjs-core/src/backends/complex_util.ts | 2 +- tfjs-core/src/backends/einsum_util.ts | 2 +- tfjs-core/src/backends/non_max_suppression_impl.ts | 2 +- tfjs-core/src/engine.ts | 2 +- tfjs-core/src/engine_test.ts | 2 +- tfjs-core/src/io/browser_files_test.ts | 2 +- tfjs-core/src/io/composite_array_buffer.ts | 2 +- tfjs-core/src/io/http.ts | 2 +- tfjs-core/src/io/indexed_db.ts | 2 +- tfjs-core/src/jasmine_util.ts | 4 ++-- tfjs-core/src/ops/depthwise_conv2d_test.ts | 2 +- tfjs-core/src/ops/ragged_tensor_to_tensor.ts | 2 +- tfjs-core/src/serialization.ts | 2 +- tfjs-core/src/tensor.ts | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tfjs-core/scripts/cloud_funcs/README.md b/tfjs-core/scripts/cloud_funcs/README.md index 2d56e9e01ec..7f4977926bf 100644 --- a/tfjs-core/scripts/cloud_funcs/README.md +++ b/tfjs-core/scripts/cloud_funcs/README.md @@ -1,7 +1,7 @@ This directory contains the following Google Cloud Functions. ### `trigger_nightly` -Programatically triggers a Cloud Build on master. This function is called by the Cloud Scheduler at 3am EST every day (configurable via the Cloud Scheduler UI). +Programmatically triggers a Cloud Build on master. This function is called by the Cloud Scheduler at 3am EST every day (configurable via the Cloud Scheduler UI). You can also trigger the function manually via the Cloud UI. Command to re-deploy: @@ -45,6 +45,6 @@ gcloud functions deploy sync_reactnative \ The pipeline looks like this: 1) At 3am, Cloud Scheduler writes to `nightly` topic -2) That triggers the `nightly` function, which starts a build programatically +2) That triggers the `nightly` function, which starts a build programmatically 3) That build runs and writes its status to `cloud-builds` topic 4) That triggers the `send_email` function, which sends email and chat with the build status. diff --git a/tfjs-core/src/backends/complex_util.ts b/tfjs-core/src/backends/complex_util.ts index 28bfdd05260..59e78069f3b 100644 --- a/tfjs-core/src/backends/complex_util.ts +++ b/tfjs-core/src/backends/complex_util.ts @@ -87,7 +87,7 @@ export function complexWithEvenIndex(complex: Float32Array): } /** - * Extracts odd indexed comple values in the given array. + * Extracts odd indexed complete values in the given array. * @param complex The complex tensor values */ export function complexWithOddIndex(complex: Float32Array): diff --git a/tfjs-core/src/backends/einsum_util.ts b/tfjs-core/src/backends/einsum_util.ts index aef34779f71..ff96aa278a7 100644 --- a/tfjs-core/src/backends/einsum_util.ts +++ b/tfjs-core/src/backends/einsum_util.ts @@ -167,7 +167,7 @@ export function checkEinsumDimSizes( * * @param summedDims indices to the dimensions being summed over. * @param idDims A look up table for the dimensions present in each input - * tensor. Each consituent array contains indices for the dimensions in the + * tensor.Each constituent array contains indices for the dimensions in the * corresponding input tensor. * * @return A map with two fields: diff --git a/tfjs-core/src/backends/non_max_suppression_impl.ts b/tfjs-core/src/backends/non_max_suppression_impl.ts index 51b45a57799..9b8683c6943 100644 --- a/tfjs-core/src/backends/non_max_suppression_impl.ts +++ b/tfjs-core/src/backends/non_max_suppression_impl.ts @@ -188,7 +188,7 @@ function intersectionOverUnion(boxes: TypedArray, i: number, j: number) { // A Gaussian penalty function, this method always returns values in [0, 1]. // The weight is a function of similarity, the more overlap two boxes are, the -// smaller the weight is, meaning highly overlapping boxe will be significantly +// smaller the weight is,meaning highly overlapping boxes will be significantly // penalized. On the other hand, a non-overlapping box will not be penalized. function suppressWeight(iouThreshold: number, scale: number, iou: number) { const weight = Math.exp(scale * iou * iou); diff --git a/tfjs-core/src/engine.ts b/tfjs-core/src/engine.ts index a29b04c24aa..0fec3e3b1f2 100644 --- a/tfjs-core/src/engine.ts +++ b/tfjs-core/src/engine.ts @@ -313,7 +313,7 @@ export class Engine implements TensorTracker, DataMover { /** * Initializes a backend by looking up the backend name in the factory * registry and calling the factory method. Returns a boolean representing - * whether the initialization of the backend suceeded. Throws an error if + * whether the initialization of the backend succeeded. Throws an error if * there is no backend in the factory registry. */ private initializeBackend(backendName: string): diff --git a/tfjs-core/src/engine_test.ts b/tfjs-core/src/engine_test.ts index 97b7e787114..6389c604b2b 100644 --- a/tfjs-core/src/engine_test.ts +++ b/tfjs-core/src/engine_test.ts @@ -243,7 +243,7 @@ describe('Backend registration', () => { throw new Error('failed to create async2'); }, 101 /* priority */); - // Await for the library to find the best backend that succesfully + // Await for the library to find the best backend that successfully // initializes. await tf.ready(); expect(tf.backend()).toEqual(testBackend); diff --git a/tfjs-core/src/io/browser_files_test.ts b/tfjs-core/src/io/browser_files_test.ts index 349cc1f172c..f48d15ebdeb 100644 --- a/tfjs-core/src/io/browser_files_test.ts +++ b/tfjs-core/src/io/browser_files_test.ts @@ -259,7 +259,7 @@ describeWithFlags('browserDownloads', BROWSER_ENVS, () => { // Verify that the default file names are used. expect(jsonAnchor.download).toEqual('model.json'); expect(jsonAnchor.clicked).toEqual(1); - // The weight file should not have been downoaded. + // The weight file should not have been downloaded. expect(weightDataAnchor.download).toEqual(undefined); expect(weightDataAnchor.clicked).toEqual(0); diff --git a/tfjs-core/src/io/composite_array_buffer.ts b/tfjs-core/src/io/composite_array_buffer.ts index 411fb074083..76015b9abdb 100644 --- a/tfjs-core/src/io/composite_array_buffer.ts +++ b/tfjs-core/src/io/composite_array_buffer.ts @@ -91,7 +91,7 @@ export class CompositeArrayBuffer { start = end; } - // Set the byteLenghth + // Set the byteLength if (this.shards.length === 0) { this.byteLength = 0; } diff --git a/tfjs-core/src/io/http.ts b/tfjs-core/src/io/http.ts index a8ba2da62ca..e5d1020a0ca 100644 --- a/tfjs-core/src/io/http.ts +++ b/tfjs-core/src/io/http.ts @@ -324,7 +324,7 @@ IORouterRegistry.registerLoadRouter(httpRouter); * The following GitHub Gist * https://gist.github.com/dsmilkov/1b6046fd6132d7408d5257b0976f7864 * implements a server based on [flask](https://github.com/pallets/flask) that - * can receive the request. Upon receiving the model artifacts via the requst, + * can receive the request. Upon receiving the model artifacts via the request, * this particular server reconstitutes instances of [Keras * Models](https://keras.io/models/model/) in memory. * diff --git a/tfjs-core/src/io/indexed_db.ts b/tfjs-core/src/io/indexed_db.ts index 42de509413d..2eb479b192f 100644 --- a/tfjs-core/src/io/indexed_db.ts +++ b/tfjs-core/src/io/indexed_db.ts @@ -255,7 +255,7 @@ IORouterRegistry.registerLoadRouter(indexedDBRouter); * * @param modelPath A unique identifier for the model to be saved. Must be a * non-empty string. - * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`), + * @returns An instance of `BrowserIndexedDB` (subclass of `IOHandler`), * which can be used with, e.g., `tf.Model.save`. */ export function browserIndexedDB(modelPath: string): IOHandler { diff --git a/tfjs-core/src/jasmine_util.ts b/tfjs-core/src/jasmine_util.ts index 19f554d18f6..bf5d28e1b9c 100644 --- a/tfjs-core/src/jasmine_util.ts +++ b/tfjs-core/src/jasmine_util.ts @@ -105,7 +105,7 @@ export interface TestFilter { * Tests that have the substrings specified by the include or startsWith * will be included in the test run, unless one of the substrings specified * by `excludes` appears in the name. - * @param customInclude Function to programatically include a test. + * @param customInclude Function to programmatically include a test. * If this function returns true, a test will immediately run. Otherwise, * `testFilters` is used for fine-grained filtering. * @@ -124,7 +124,7 @@ export function setupTestFilters( * Filter method that returns boolean, if a given test should run or be * ignored based on its name. The exclude list has priority over the * include list. Thus, if a test matches both the exclude and the include - * list, it will be exluded. + * list, it will be excluded. */ // tslint:disable-next-line: no-any const specFilter = (spec: any) => { diff --git a/tfjs-core/src/ops/depthwise_conv2d_test.ts b/tfjs-core/src/ops/depthwise_conv2d_test.ts index e6ccc7b0e2a..83e1b34f775 100644 --- a/tfjs-core/src/ops/depthwise_conv2d_test.ts +++ b/tfjs-core/src/ops/depthwise_conv2d_test.ts @@ -1214,7 +1214,7 @@ describeWithFlags('depthwiseConv2d gradients', ALL_ENVS, () => { [[[1, 1], [1, 1], [0, 0]], [[0, 1], [1, 1], [1, 1]]], [[[1, 0], [1, 1], [0, 0]], [[0, 1], [1, 0], [0, 0]]] ]); - // result of convolution operatoin + // result of convolution operation result = tf.tensor4d([ [ [[2, 8, 8, 7, 2, 2], [6, 3, 1, 1, 0, 0]], diff --git a/tfjs-core/src/ops/ragged_tensor_to_tensor.ts b/tfjs-core/src/ops/ragged_tensor_to_tensor.ts index 2485a16a335..e3c85df50e4 100644 --- a/tfjs-core/src/ops/ragged_tensor_to_tensor.ts +++ b/tfjs-core/src/ops/ragged_tensor_to_tensor.ts @@ -70,7 +70,7 @@ import {op} from './operation'; * "ROW_SPLITS": the row_splits tensor from the ragged tensor. * "VALUE_ROWIDS": the value_rowids tensor from the ragged tensor. * "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then - * it is preceeded by "FIRST_DIM_SIZE". The tensors are in the order of + * it is preceded by "FIRST_DIM_SIZE". The tensors are in the order of * the dimensions. * @return A Tensor. Has the same type as values. * @doc {heading: 'Operations', subheading: 'Ragged'} diff --git a/tfjs-core/src/serialization.ts b/tfjs-core/src/serialization.ts index 621a9a63962..14d452b39e9 100644 --- a/tfjs-core/src/serialization.ts +++ b/tfjs-core/src/serialization.ts @@ -225,7 +225,7 @@ export class SerializationMap { * * @param cls The class to be registered. It must have a public static member * called `className` defined and the value must be a non-empty string. - * @param pkg The pakcage name that this class belongs to. This used to define + * @param pkg The package name that this class belongs to. This used to define * the key in GlobalCustomObject. If not defined, it defaults to `Custom`. * @param name The name that user specified. It defaults to the actual name of * the class as specified by its static `className` property. diff --git a/tfjs-core/src/tensor.ts b/tfjs-core/src/tensor.ts index 137d3b48705..9b37029807f 100644 --- a/tfjs-core/src/tensor.ts +++ b/tfjs-core/src/tensor.ts @@ -518,7 +518,7 @@ Object.defineProperty(Tensor, Symbol.hasInstance, { export function getGlobalTensorClass() { // Use getGlobal so that we can augment the Tensor class across package - // boundaries becase the node resolution alg may result in different modules + // boundaries because the node resolution alg may result in different modules // being returned for this file depending on the path they are loaded from. return getGlobal('Tensor', () => { return Tensor;