Repository Analysis

tensorflow/tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.

3.3 Likely human-written View on GitHub
3.3
Adjusted Score
3.3
Raw Score
100%
Time Factor
2026-05-28
Last Push
19,121
Stars
TypeScript
Language
428,898
Lines of Code
3109
Files
973
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 11HIGH 29MEDIUM 116LOW 817

Pattern Findings

973 matches across 18 categories. Click a row to expand file-level details.

Over-Commented Block338 hits · 322 pts
SeverityFileLineSnippet
LOWtfjs-automl/scripts/build-npm.sh1#!/usr/bin/env bash
LOWtfjs-automl/scripts/test-ci.sh1#!/usr/bin/env bash
LOWtools/enumerate-tests.ts1#!/usr/bin/env node
LOWtools/make_version_test_file.ts1#!/usr/bin/env node
LOWtfjs-core/scripts/test-bundle-size.js1#!/usr/bin/env node
LOWtfjs-core/scripts/build-npm.sh1#!/usr/bin/env bash
LOWtfjs-core/src/util_base.ts741 // 1. It only reliably works for es6 Promise, not other Promise
LOWtfjs-core/src/hash_util_test.ts41 const MAX_INT32 = ACMRandom.MAX_INT32;
LOWtfjs-core/src/optimizers/rmsprop_optimizer_test.ts41 // epsilon = 1e-8
LOWtfjs-core/src/optimizers/rmsprop_optimizer_test.ts101 expect(tf.memory().numTensors).toBe(numTensors + 4);
LOWtfjs-core/src/optimizers/rmsprop_optimizer_test.ts121 // x = [0.54117, 1.541169]
LOWtfjs-core/src/optimizers/adam_optimizer_test.ts41 // beta1 * old_first_m_w1 + (1-beta1) * grad_w1,
LOWtfjs-core/src/optimizers/adam_optimizer_test.ts61 // beta1 * old_first_m_w2 + (1-beta1) * grad_w2
LOWtfjs-core/src/optimizers/adamax_optimizer_test.ts41 expect(tf.memory().numTensors).toBe(numTensors + 3);
LOWtfjs-core/src/optimizers/adamax_optimizer_test.ts61 // w2_old - updates_2
LOWtfjs-core/src/optimizers/adamax_optimizer_test.ts81 // 0.9 * 4,
LOWtfjs-core/src/optimizers/adagrad_optimizer_test.ts41 // newAccumulatedGrad = accumulatedGrad + grad^2
LOWtfjs-core/src/optimizers/adadelta_optimizer_test.ts41 // newAccumulatedGrad = rho * accumulatedGrad + (1 - rho) * grad ^ 2
LOWtfjs-core/src/ops/confusion_matrix_test.ts21
LOWtfjs-core/src/ops/confusion_matrix_test.ts61 //
LOWtfjs-core/src/ops/reverse_4d_test.ts21
LOWtfjs-core/src/ops/reverse_4d_test.ts41 // ],
LOWtfjs-core/src/ops/conv2d_transpose_test.ts261 // x = tf.constant(np.array([[
LOWtfjs-core/src/ops/conv2d_transpose_test.ts321 expectArraysClose(await filtGrad.data(), await expectedFiltGrad.data());
LOWtfjs-core/src/ops/conv2d_transpose_test.ts381 const expectedFiltGrad = tf.ones([2, 2, 2, 1]).mul(tf.scalar(-0.01444618));
LOWtfjs-core/src/ops/conv2d_transpose_test.ts401 // [[[0.34968338], [-0.42306114]], [[1.27395733], [-1.09014535]]]
LOWtfjs-core/src/ops/conv2d_transpose_test.ts501 // ```py
LOWtfjs-core/src/ops/reverse_3d_test.ts21
LOWtfjs-core/src/ops/moving_average_test.ts21
LOWtfjs-core/src/ops/moving_average_test.ts81 //
LOWtfjs-core/src/ops/log_softmax.ts61 if (axis !== $logits.rank - 1) {
LOWtfjs-core/src/ops/pad_test.ts201 // 0, 0, 0
LOWtfjs-backend-cpu/scripts/build-npm.sh1#!/usr/bin/env bash
LOW…s-backend-cpu/src/kernels/RaggedTensorToTensor_impl.ts201 // -1 indicates an element or list that is out of range.
LOWtfjs-backend-cpu/src/kernels/Unique_impl.ts21 values: BackendValues, axis: number, shape: number[], dtype: DataType): {
LOWtfjs-backend-cpu/src/kernels/Unique_impl.ts41 // intermediate TensorBuffer (see inputBuffer below) to allow us to extract
LOWtfjs-backend-cpu/src/kernels/Unique_impl.ts61 // ],
LOWtfjs-layers/tools/clang_format_ts.sh1#!/bin/bash
LOWtfjs-layers/src/losses_test.ts181 expectTensorsClose(result, expected);
LOWtfjs-layers/src/losses_test.ts221 // with tf.Session() as sess:
LOWtfjs-layers/src/losses_test.ts261 //
LOWtfjs-layers/src/metrics_test.ts81 // Use the following Python code to generate the reference values:
LOWtfjs-layers/src/metrics_test.ts101 const accuracy = tfl.metrics.binaryCrossentropy(x, y);
LOWtfjs-layers/src/metrics_test.ts181 });
LOWtfjs-layers/src/metrics_test.ts201 // ])
LOWtfjs-layers/src/metrics_test.ts241 //
LOWtfjs-layers/src/layers/advanced_activation_test.ts81describeMathCPUAndWebGL2('PReLU: Tensor', () => {
LOWtfjs-layers/src/layers/advanced_activation_test.ts121 expect(history.history.loss[2]).toBeCloseTo(0.049144);
LOWtfjs-layers/src/layers/convolutional_test.ts481 // # the 3D convolutions.
LOWtfjs-layers/src/layers/convolutional_test.ts501 // # 178., 186., 190., 194., 202., 206., 210.], dtype=float32)
LOWtfjs-layers/src/layers/convolutional_test.ts741 // tslint:disable-next-line:no-any
LOWtfjs-layers/src/layers/convolutional_test.ts841 // ```python
LOWtfjs-layers/src/layers/core_test.ts821 // model.add(tf.keras.layers.SimpleRNN(
LOWtfjs-layers/src/layers/core_test.ts841 });
LOWtfjs-layers/src/layers/wrappers_test.ts81 });
LOWtfjs-layers/src/layers/wrappers_test.ts121 ]]));
LOWtfjs-layers/src/layers/wrappers_test.ts141 // z1 = keras.layers.Embedding(10,
LOWtfjs-layers/src/layers/wrappers_test.ts361 // The golden tensor values used in the tests below can be obtained with
LOWtfjs-layers/src/layers/wrappers_test.ts461 // rnn = keras.layers.LSTM(
LOWtfjs-layers/src/layers/wrappers_test.ts501 });
278 more matches not shown…
Decorative Section Separators97 hits · 291 pts
SeverityFileLineSnippet
MEDIUMtfjs-automl/scripts/build-npm.sh15# =============================================================================
MEDIUMtfjs-automl/scripts/test-ci.sh15# =============================================================================
MEDIUMtfjs-core/scripts/build-npm.sh15# =============================================================================
MEDIUMtfjs-backend-cpu/scripts/build-npm.sh15# =============================================================================
MEDIUMtfjs-layers/tools/clang_format_ts.sh8# ==============================================================================
MEDIUMtfjs-backend-webgpu/scripts/publish-npm.sh15# =============================================================================
MEDIUMtfjs-backend-webgpu/scripts/build-npm.sh15# =============================================================================
MEDIUMtfjs-inference/python/inference.py14# ==============================================================================
MEDIUMtfjs-inference/scripts/run_python.sh8# =============================================================================
MEDIUMscripts/buildifier-ci.sh15# =============================================================================
MEDIUMscripts/publish-npm.sh15# =============================================================================
MEDIUMscripts/run_bazel_ci_tests.sh15# =============================================================================
MEDIUMscripts/run-build.sh15# =============================================================================
MEDIUM.github/workflows/stale.yaml14# ==============================================================================
MEDIUMtfjs-backend-wasm/scripts/build-ci.sh15# =============================================================================
MEDIUMtfjs-backend-wasm/scripts/build-wasm.sh15# =============================================================================
MEDIUMtfjs-backend-wasm/scripts/build-npm.sh15# =============================================================================
MEDIUMtfjs-backend-wasm/scripts/test-ci.sh8# =============================================================================
MEDIUMtfjs/scripts/build-npm.sh15# =============================================================================
MEDIUMtfjs/scripts/test-ci.sh15# =============================================================================
MEDIUMtfjs-react-native/integration_rn59/scripts/test-ci.sh15# =============================================================================
MEDIUMtfjs-react-native/scripts/update-apk.sh15# =============================================================================
MEDIUMe2e/integration_tests/convert_predict.py14# =============================================================================
MEDIUMe2e/integration_tests/metadata.py14# =============================================================================
MEDIUMe2e/integration_tests/create_save_predict.py6# =============================================================================
MEDIUMe2e/custom_module/dense_model/build.sh16# ==============================================================================
MEDIUMe2e/custom_module/universal_sentence_encoder/build.sh16# ==============================================================================
MEDIUMe2e/custom_module/blazeface/build.sh16# ==============================================================================
MEDIUMe2e/scripts/local-registry.sh15# ==============================================================================
MEDIUMe2e/scripts/create-python-models.sh15# ==============================================================================
MEDIUMe2e/scripts/release-e2e.sh15# ==============================================================================
MEDIUMe2e/scripts/run-custom-builds.sh16# ==============================================================================
MEDIUMe2e/scripts/deploy-benchmarks.sh15# ==============================================================================
MEDIUMe2e/scripts/test-ci.sh15# ==============================================================================
MEDIUMe2e/scripts/build-deps-ci.sh15# ==============================================================================
MEDIUMe2e/scripts/cleanup-py-env.sh16# ==============================================================================
MEDIUMe2e/scripts/test.sh15# ==============================================================================
MEDIUMe2e/scripts/create_save_predict.sh16# ==============================================================================
MEDIUMe2e/scripts/fetch-graph-model-golden-data-ci.sh15# ==============================================================================
MEDIUMe2e/scripts/setup-py-env.sh16# ==============================================================================
MEDIUMtfjs-node/python/int64_model.py14# ==============================================================================
MEDIUMtfjs-node/python/unint8_model.py14# ==============================================================================
MEDIUMtfjs-node/scripts/publish-npm.sh15# =============================================================================
MEDIUMtfjs-node/scripts/publish-npm-gpu.sh15# =============================================================================
MEDIUMtfjs-node/scripts/build-npm.sh15# =============================================================================
MEDIUMtfjs-node/scripts/build-and-upload-addon.sh14# =============================================================================
MEDIUMtfjs-data/scripts/build-npm.sh15# =============================================================================
MEDIUMtfjs-data/scripts/test-ci.sh8# =============================================================================
MEDIUMtfjs-converter/python/update_locked_deps.sh15# =============================================================================
MEDIUMtfjs-converter/python/build-pip-package.sh15# ==============================================================================
MEDIUMtfjs-converter/python/run-python-tests.sh15# ==============================================================================
MEDIUMtfjs-converter/python/setup.py14# ==============================================================================
MEDIUMtfjs-converter/python/test_nightly_pip_package.py14# ==============================================================================
MEDIUMtfjs-converter/python/test_pip_package.py14# ==============================================================================
MEDIUMtfjs-converter/python/tensorflowjs/quantization_test.py14# ==============================================================================
MEDIUMtfjs-converter/python/tensorflowjs/write_weights.py14# ==============================================================================
MEDIUM…-converter/python/tensorflowjs/resource_loader_test.py14# ==============================================================================
MEDIUMtfjs-converter/python/tensorflowjs/quantization.py14# ==============================================================================
MEDIUMtfjs-converter/python/tensorflowjs/read_weights.py14# ==============================================================================
MEDIUMtfjs-converter/python/tensorflowjs/__init__.py14# ==============================================================================
37 more matches not shown…
Hyper-Verbose Identifiers279 hits · 280 pts
SeverityFileLineSnippet
LOWrollup.config.helpers.js31export function getBrowserBundleConfigOptions(
LOWtfjs-automl/src/object_detection.ts126function calculateMostLikelyLabels(
LOWtfjs-core/scripts/test_snippets/util.ts179function convertDocStringToDocInfoObject(docString: string): JSDoc {
LOWtfjs-core/src/util_base.ts620export function convertBackendValuesAndArrayBuffer(
LOWtfjs-core/src/util_base.ts678export function assertNonNegativeIntegerDimensions(shape: number[]) {
LOWtfjs-core/src/jasmine_util.ts167export function parseTestEnvFromKarmaFlags(
LOWtfjs-core/src/engine.ts1289export function getOrMakeEngine(): Engine {
LOWtfjs-core/src/globals.ts56export function disableDeprecationWarnings(): void {
LOWtfjs-core/src/tensor_util_env.ts57function deepAssertShapeConsistency(
LOWtfjs-core/src/io/io_utils.ts495export function getModelJSONForModelArtifacts(
LOWtfjs-core/src/io/io_utils.ts533export function getModelArtifactsForJSONSync(
LOWtfjs-core/src/io/io_utils.ts602export function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts):
LOWtfjs-core/src/io/local_storage.ts40export function purgeLocalStorageArtifacts(): string[] {
LOWtfjs-core/src/ops/segment_util.ts30export function segOpComputeOptimalWindowSize(
LOWtfjs-core/src/ops/broadcast_util.ts60export function assertAndGetBroadcastShape(
LOWtfjs-core/src/ops/pool.ts133function requiredSpaceToBatchPaddings(
LOWtfjs-core/src/ops/pool.ts149function withSpaceToBatchBasePaddings(
LOWtfjs-core/src/ops/ragged_to_dense_util.ts27export function combineRaggedTensorToTensorShapes(
LOWtfjs-core/src/ops/ragged_to_dense_util.ts78export function getRowPartitionTypesHelper(rowPartitionTypeStrings: string[]) {
LOWtfjs-core/src/ops/ragged_to_dense_util.ts110export function validateDefaultValueShape(
LOWtfjs-core/src/ops/conv3d_test.ts39function generateGradientCaseInputs(
LOWtfjs-core/src/ops/browser.ts183function isImageBitmapFullySupported() {
LOWtfjs-core/src/ops/browser.ts194function canWrapPixelsToImageBitmap(pixels: PixelData|ImageData|
LOWtfjs-core/src/ops/rand_util.ts233export function expectArrayInMeanStdRange(
LOWtfjs-core/src/ops/conv_util.ts571export function eitherStridesOrDilationsAreOne(
LOWtfjs-core/src/ops/conv_util.ts576export function stridesOrDilationsArePositive(values: number|
LOWtfjs-core/src/ops/conv_util.ts614export function checkPadOnDimRoundingMode(
LOWtfjs-core/src/ops/axis_util.ts49export function computeOutAndReduceShapes(
LOWtfjs-core/src/ops/axis_util.ts68export function assertAxesAreInnerMostDims(
LOWtfjs-core/src/ops/slice_util.ts209export function startIndicesWithElidedDims(
LOWtfjs-core/src/ops/slice_util.ts234export function stopIndicesWithElidedDims(
LOWtfjs-core/src/ops/sparse/sparse_reshape_util.ts25export function getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(
LOWtfjs-core/src/ops/sparse/sparse_reshape_util.ts36export function getSparseReshapeNegativeOutputDimErrorMessage(
LOWtfjs-core/src/ops/sparse/sparse_reshape_util.ts45export function getSparseReshapeEmptyTensorZeroOutputDimErrorMessage() {
LOWtfjs-core/src/ops/sparse/sparse_reshape_util.ts56export function getSparseReshapeInputOutputMultipleErrorMessage(
LOWtfjs-core/src/ops/sparse/sparse_reshape_util.ts71export function getSparseReshapeInputOutputMismatchErrorMessage(
LOWtfjs-core/src/ops/sparse/sparse_fill_empty_rows_util.ts23export function getSparseFillEmptyRowsIndicesDenseShapeMismatch(
LOWtfjs-core/src/ops/sparse/sparse_fill_empty_rows_util.ts35export function getSparseFillEmptyRowsNegativeIndexErrorMessage(
LOWtfjs-core/src/ops/sparse/sparse_fill_empty_rows_util.ts47export function getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(
LOW…s-core/src/ops/sparse/sparse_segment_reduction_util.ts22export function getSparseSegmentReductionNegativeSegmentIdsErrorMessage() {
LOW…s-core/src/ops/sparse/sparse_segment_reduction_util.ts30export function getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage() {
LOW…s-core/src/ops/sparse/sparse_segment_reduction_util.ts40export function getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(
LOW…s-core/src/ops/sparse/sparse_segment_reduction_util.ts53export function getSparseSegmentReductionIndicesOutOfRangeErrorMessage(
LOW…s-backend-cpu/src/kernels/ResizeNearestNeighborGrad.ts23export function resizeNearestNeighborGrad(args: {
LOW…backend-cpu/src/kernels/StringToHashBucketFast_impl.ts20export function stringToHashBucketFastImpl(
LOW…backend-cpu/src/kernels/SparseSegmentReduction_impl.ts20export function sparseSegmentReductionImpl(
LOWtfjs-backend-cpu/src/utils/binary_impl.ts25export function createSimpleBinaryKernelImpl(op: SimpleBinaryOperation):
LOWtfjs-backend-cpu/src/utils/binary_utils.ts135export function createComplexBinaryKernelImpl(op: ComplexBinaryOperation):
LOWtfjs-layers/src/user_defined_metadata_test.ts94 function createSequentialModelForTest(): Sequential {
LOWtfjs-layers/src/user_defined_metadata_test.ts104 function createFunctionalModelForTest(): tfl.LayersModel {
LOWtfjs-layers/src/losses.ts45export function meanAbsolutePercentageError(
LOWtfjs-layers/src/losses.ts56export function meanSquaredLogarithmicError(
LOWtfjs-layers/src/losses.ts136export function sparseCategoricalCrossentropy(
LOWtfjs-layers/src/losses.ts171export function sigmoidCrossEntropyWithLogits(
LOWtfjs-layers/src/losses.ts202export function kullbackLeiblerDivergence(
LOWtfjs-layers/src/exports_metrics.ts88export function sparseCategoricalAccuracy(
LOWtfjs-layers/src/exports_metrics.ts275export function meanAbsolutePercentageError(
LOWtfjs-layers/src/models.ts282export async function loadLayersModelFromIOHandler(
LOWtfjs-layers/src/models.ts344function decodeModelAndOptimizerWeights(
LOWtfjs-layers/src/metrics.ts92export function sparseCategoricalAccuracy(
219 more matches not shown…
Hallucination Indicators11 hits · 140 pts
SeverityFileLineSnippet
CRITICALe2e/integration_tests/convert_predict.py147 builder = tf.compat.v1.saved_model.builder.SavedModelBuilder(save_dir)
CRITICALe2e/integration_tests/convert_predict.py386 builder = tf.compat.v1.saved_model.builder.SavedModelBuilder(save_dir)
CRITICALtfjs-data/src/dataset_test.ts368 expect(compare.complexThenBatch.a.q.ab.x.dataSync())
CRITICALtfjs-data/src/dataset_test.ts369 .toEqual(compare.batchThenComplex.a.q.ab.x.dataSync());
CRITICALtfjs-data/src/dataset_test.ts373 expect(compare.complexThenBatch.b.bb.bbb.dataSync())
CRITICALtfjs-data/src/dataset_test.ts374 .toEqual(compare.batchThenComplex.b.bb.bbb.dataSync());
CRITICALtfjs-data/src/dataset_test.ts378 expect(compare.complexThenBatch.c.ca.x.dataSync())
CRITICALtfjs-data/src/dataset_test.ts379 .toEqual(compare.batchThenComplex.c.ca.x.dataSync());
CRITICAL…flowjs/converters/tf_saved_model_conversion_v2_test.py70 builder = tf.compat.v1.saved_model.builder.SavedModelBuilder(save_dir)
CRITICAL…flowjs/converters/tf_saved_model_conversion_v2_test.py108 builder = tf.compat.v1.saved_model.builder.SavedModelBuilder(
CRITICAL…flowjs/converters/tf_saved_model_conversion_v2_test.py385 builder = tf.compat.v1.saved_model.builder.SavedModelBuilder(
Unused Imports124 hits · 124 pts
SeverityFileLineSnippet
LOWtfjs-inference/python/inference_test.py18
LOWtfjs-inference/python/inference_test.py19
LOWtfjs-inference/python/inference_test.py20
LOWtfjs-inference/python/inference.py17
LOWtfjs-inference/python/inference.py18
LOWtfjs-inference/python/inference.py19
LOWe2e/integration_tests/convert_predict.py24
LOWe2e/integration_tests/convert_predict.py25
LOWe2e/integration_tests/convert_predict.py26
LOWe2e/integration_tests/convert_predict.py28
LOWe2e/integration_tests/convert_predict.py29
LOWe2e/integration_tests/convert_predict.py34
LOWe2e/integration_tests/convert_predict.py36
LOWe2e/integration_tests/convert_predict.py48
LOWe2e/integration_tests/metadata.py24
LOWe2e/integration_tests/metadata.py25
LOWe2e/integration_tests/metadata.py26
LOWe2e/integration_tests/metadata.py28
LOWe2e/integration_tests/metadata.py29
LOWe2e/integration_tests/metadata.py34
LOWe2e/integration_tests/metadata.py36
LOWe2e/integration_tests/metadata.py38
LOWe2e/integration_tests/metadata.py39
LOWe2e/integration_tests/metadata.py42
LOWe2e/integration_tests/metadata.py43
LOWe2e/integration_tests/metadata.py47
LOWe2e/integration_tests/metadata.py48
LOWe2e/integration_tests/create_save_predict.py15
LOWe2e/integration_tests/create_save_predict.py16
LOWe2e/integration_tests/create_save_predict.py17
LOWe2e/integration_tests/create_save_predict.py21
LOWe2e/integration_tests/create_save_predict.py22
LOWe2e/integration_tests/create_save_predict.py28
LOWtfjs-node/python/int64_model.py22
LOWtfjs-converter/python/test_nightly_pip_package.py17
LOWtfjs-converter/python/test_nightly_pip_package.py18
LOWtfjs-converter/python/test_nightly_pip_package.py19
LOWtfjs-converter/python/test_pip_package.py17
LOWtfjs-converter/python/test_pip_package.py18
LOWtfjs-converter/python/test_pip_package.py19
LOWtfjs-converter/python/tensorflowjs/quantization_test.py15
LOWtfjs-converter/python/tensorflowjs/quantization_test.py16
LOWtfjs-converter/python/tensorflowjs/quantization_test.py17
LOW…-converter/python/tensorflowjs/resource_loader_test.py16
LOW…-converter/python/tensorflowjs/resource_loader_test.py17
LOW…-converter/python/tensorflowjs/resource_loader_test.py18
LOWtfjs-converter/python/tensorflowjs/quantization.py15
LOWtfjs-converter/python/tensorflowjs/quantization.py16
LOWtfjs-converter/python/tensorflowjs/quantization.py17
LOWtfjs-converter/python/tensorflowjs/read_weights.py17
LOWtfjs-converter/python/tensorflowjs/read_weights.py18
LOWtfjs-converter/python/tensorflowjs/read_weights.py19
LOWtfjs-converter/python/tensorflowjs/__init__.py16
LOWtfjs-converter/python/tensorflowjs/__init__.py17
LOWtfjs-converter/python/tensorflowjs/__init__.py18
LOWtfjs-converter/python/tensorflowjs/__init__.py21
LOWtfjs-converter/python/tensorflowjs/__init__.py22
LOWtfjs-converter/python/tensorflowjs/resource_loader.py17
LOWtfjs-converter/python/tensorflowjs/resource_loader.py18
LOWtfjs-converter/python/tensorflowjs/resource_loader.py19
64 more matches not shown…
Docstring Block Structure19 hits · 95 pts
SeverityFileLineSnippet
HIGHtfjs-converter/python/tensorflowjs/quantization.py34Maps node names to their quantization dtypes. Given a quantization_dtype_map which maps dtypes `uint8`, `uint16`, `fl
HIGHtfjs-converter/python/tensorflowjs/quantization.py94Quantizes the weights by linearly re-scaling across available bits. The weights are quantized by linearly re-scaling
HIGHtfjs-converter/python/tensorflowjs/quantization.py176Computes quantization range to ensure that zero is represented if covered. Gymnastics with nudged zero point is to en
HIGHtfjs-converter/python/tensorflowjs/read_weights.py127Load weight values from buffer(s) according to a weights manifest. Args: weights_manifest: A TensorFlow.js-format
HIGHtfjs-converter/python/tensorflowjs/resource_loader.py25Opens the file at given path, where path is relative to tensorflowjs/. Args: path: a string resource path relativ
HIGHtfjs-converter/python/tensorflowjs/resource_loader.py41List the files inside a dir where path is relative to tensorflowjs/. Args: path: a string path to a resource dire
HIGH…r/python/tensorflowjs/converters/normalize_bias_add.py24Convert AddV2 ops and Add ops to BiasAdd if they could be fused with the ancestor node. Grappler and the TFJS's fus
HIGH…r/python/tensorflowjs/converters/graph_rewrite_util.py28Pulls a node def from a dictionary for a given name. Args: node_map: Dictionary containing an entry indexed by na
HIGH…r/python/tensorflowjs/converters/graph_rewrite_util.py47Extracts the values from a const NodeDef as a numpy ndarray. Args: node_def: Const NodeDef that has the values we
HIGH…converter/python/tensorflowjs/converters/fuse_prelu.py30Modifies the provided graph by fusing a set of ops into a single Prelu op. The formula of PReLU is: f(x) = alpha * x
HIGH…converter/python/tensorflowjs/converters/fuse_prelu.py142Tensorflow does not support Prelu op, and the grappler remap optimizer will not fuse the prelu op with _FusedConv2D op
HIGH…er/python/tensorflowjs/converters/keras_tfjs_loader.py242Load a Keras Model from TensorFlow.js-format artifacts from file system Args: config_json_path: Path to the Tenso
HIGH…er/python/tensorflowjs/converters/keras_tfjs_loader.py309Load a Keras Model from TensorFlow.js-format artifacts from file system Args: config_json_path: Path to the Tenso
HIGH…/python/tensorflowjs/converters/keras_h5_conversion.py202Load topology & weight values from HDF5 file and convert. The HDF5 file is one generated by Keras' save_model method
HIGH…/python/tensorflowjs/converters/keras_h5_conversion.py254Load topology & weight values from HDF5 file and convert. The HDF5 weights file is one generated by Keras's save_mode
HIGH…/python/tensorflowjs/converters/keras_h5_conversion.py321Load weight values from a Keras HDF5 file and to a binary format. The HDF5 file is one generated by Keras' Model.save
HIGH…ython/tensorflowjs/converters/fuse_depthwise_conv2d.py98Modifies the provided graph by fusing a set of ops into a single _FusedDepthwiseConv2d op. DepthwiseConv2dNative +
HIGH…ython/tensorflowjs/converters/fuse_depthwise_conv2d.py126Modifies the provided graph by fusing a set of ops into a single _FusedDepthwiseConv2d op. DepthwiseConv2dNative +
HIGH…ter/python/tensorflowjs/converters/fold_batch_norms.py51Removes batch normalization ops by folding them into convolutions. Batch normalization during training has multiple d
Self-Referential Comments16 hits · 46 pts
SeverityFileLineSnippet
MEDIUMtfjs-backend-wasm/tools/cpplint.py5537 # The following function is just a speed up, no semantics are changed.
MEDIUMe2e/integration_tests/convert_predict.py16# This file is 1/2 of the test suites for CUJ: convert->predict.
MEDIUMe2e/integration_tests/convert_predict.py146 # Create a builder.
MEDIUMe2e/integration_tests/convert_predict.py385 # Create a builder.
MEDIUMe2e/integration_tests/convert_predict.py495 # Create the directory to store model and data.
MEDIUMe2e/integration_tests/metadata.py16# This file is 1/2 of the test suites for CUJ: convert->predict.
MEDIUMe2e/integration_tests/metadata.py97 # Create the directory to store model and data.
MEDIUMe2e/integration_tests/create_save_predict.py8# This file is 2/3 of the test suites for CUJ: create->save->predict.
MEDIUMtfjs-converter/python/build-pip-package.sh247 # Create a virtualenv and install twine in it for uploading.
MEDIUMtfjs-converter/python/test_pip_package.py91 # Create a builder.
MEDIUMtfjs-converter/python/test_pip_package.py136 # Create a builder
MEDIUM…flowjs/converters/tf_saved_model_conversion_v2_test.py68 # Create a builder.
MEDIUM…flowjs/converters/tf_saved_model_conversion_v2_test.py106 # Create a builder.
MEDIUM…flowjs/converters/tf_saved_model_conversion_v2_test.py384 # Create a builder
MEDIUM…ensorflowjs/converters/tf_saved_model_conversion_v2.py893 # Define the strip graph functions when TransformGraph is available, this will
MEDIUM…erter/python/tensorflowjs/converters/converter_test.py700 # Create a fie at the path to elicit the error.
Deep Nesting46 hits · 32 pts
SeverityFileLineSnippet
LOWtfjs-backend-wasm/tools/cpplint.py583
LOWtfjs-backend-wasm/tools/cpplint.py1188
LOWtfjs-backend-wasm/tools/cpplint.py1288
LOWtfjs-backend-wasm/tools/cpplint.py1519
LOWtfjs-backend-wasm/tools/cpplint.py1641
LOWtfjs-backend-wasm/tools/cpplint.py2780
LOWtfjs-backend-wasm/tools/cpplint.py3046
LOWtfjs-backend-wasm/tools/cpplint.py3117
LOWtfjs-backend-wasm/tools/cpplint.py3171
LOWtfjs-backend-wasm/tools/cpplint.py3299
LOWtfjs-backend-wasm/tools/cpplint.py3658
LOWtfjs-backend-wasm/tools/cpplint.py3736
LOWtfjs-backend-wasm/tools/cpplint.py4002
LOWtfjs-backend-wasm/tools/cpplint.py4129
LOWtfjs-backend-wasm/tools/cpplint.py4279
LOWtfjs-backend-wasm/tools/cpplint.py4526
LOWtfjs-backend-wasm/tools/cpplint.py4600
LOWtfjs-backend-wasm/tools/cpplint.py5013
LOWtfjs-backend-wasm/tools/cpplint.py5152
LOWtfjs-backend-wasm/tools/cpplint.py5498
LOWtfjs-backend-wasm/tools/cpplint.py5946
LOWtfjs-backend-wasm/tools/cpplint.py6145
LOWtfjs-backend-wasm/tools/cpplint.py808
LOWtfjs-backend-wasm/tools/cpplint.py1452
LOWtfjs-backend-wasm/tools/cpplint.py2525
LOWtfjs-backend-wasm/tools/cpplint.py2582
LOWtfjs-converter/python/setup.py28
LOWtfjs-converter/python/tensorflowjs/quantization.py33
LOWtfjs-converter/python/tensorflowjs/read_weights.py126
LOW…r/python/tensorflowjs/converters/graph_rewrite_util.py81
LOW…r/python/tensorflowjs/converters/graph_rewrite_util.py108
LOW…-converter/python/tensorflowjs/converters/converter.py534
LOW…-converter/python/tensorflowjs/converters/converter.py588
LOW…-converter/python/tensorflowjs/converters/converter.py609
LOWtfjs-converter/python/tensorflowjs/converters/wizard.py91
LOWtfjs-converter/python/tensorflowjs/converters/wizard.py214
LOWtfjs-converter/python/tensorflowjs/converters/wizard.py294
LOW…/python/tensorflowjs/converters/keras_h5_conversion.py183
LOW…/python/tensorflowjs/converters/keras_h5_conversion.py294
LOW…thon/tensorflowjs/converters/keras_tfjs_loader_test.py308
LOW…ter/python/tensorflowjs/converters/fold_batch_norms.py50
LOW…ensorflowjs/converters/tf_saved_model_conversion_v2.py370
LOW…ensorflowjs/converters/tf_saved_model_conversion_v2.py412
LOW…ensorflowjs/converters/tf_saved_model_conversion_v2.py492
LOW…ensorflowjs/converters/tf_saved_model_conversion_v2.py882
LOW…ensorflowjs/converters/tf_saved_model_conversion_v2.py896
Cross-File Repetition5 hits · 25 pts
SeverityFileLineSnippet
HIGHtfjs-node/python/int64_model.py0test a basic model with functions to make sure functions are inlined.
HIGHtfjs-node/python/unint8_model.py0test a basic model with functions to make sure functions are inlined.
HIGH…onverter/python/tensorflowjs/converters/wizard_test.py0test a basic model with functions to make sure functions are inlined.
HIGH…flowjs/converters/tf_saved_model_conversion_v2_test.py0test a basic model with functions to make sure functions are inlined.
HIGH…rter/python/tensorflowjs/converters/fuse_prelu_test.py0test a basic model with functions to make sure functions are inlined.
Verbosity Indicators10 hits · 15 pts
SeverityFileLineSnippet
LOWtfjs-core/src/ops/slice_util.ts442 // Step 1: Account for ellipsis and new axis.
LOWtfjs-core/src/ops/slice_util.ts473 // Step 2: Make a sparse spec into a full index spec.
LOWtfjs-core/src/ops/slice_util.ts492 // Step 3: Make implicit ranges (non-zero beginMasks and endMasks) explicit
LOWtfjs-core/src/ops/slice_util.ts601 // Step 4: Compute the final shape
LOWtfjs-backend-webgpu/src/kernels/TopK.ts118 // Step 1: local sort
LOWtfjs-backend-webgpu/src/kernels/TopK.ts126 // Step 2: merge
LOWtfjs-backend-webgpu/src/kernels/TopK.ts141 // Step 3: rebuild
LOWtfjs-backend-webgl/src/kernels/TopK.ts135 // Step 1: local sort
LOWtfjs-backend-webgl/src/kernels/TopK.ts143 // Step 2: merge
LOWtfjs-backend-webgl/src/kernels/TopK.ts154 // Step 3: rebuild
Redundant / Tautological Comments15 hits · 13 pts
SeverityFileLineSnippet
LOW.github/workflows/tfjs-release-branch-publish-test.yml41 RELEASE: 'true' # Set RELEASE to true as requested
LOW…ub/workflows/tfjs-nightly-release-and-publish-test.yml39 RELEASE: 'true' # Set RELEASE to true as in the original config
LOWtfjs-backend-wasm/tools/cpplint.py2506 # Check if token is an unmatched '<'.
LOWtfjs-backend-wasm/tools/cpplint.py3129 # Check if the // may be in quotes. If so, ignore it
LOWtfjs-backend-wasm/tools/cpplint.py4085 # Check if the body is empty
LOWtfjs-backend-wasm/tools/cpplint.py4376 # Check if the line is a header guard.
LOWtfjs-backend-wasm/tools/cpplint.py4735 # Check if people are using the verboten C basic types. The only exception
LOWtfjs-backend-wasm/tools/cpplint.py4747 # Check if some verboten operator overloading is going on
LOWtfjs-backend-wasm/tools/cpplint.py4923 # Check if some verboten C functions are being used.
LOWtfjs-backend-wasm/tools/cpplint.py5678 # Set end_col to check whole lines after we are done with the
LOWe2e/scripts/local-registry.sh33 # Set registry to local registry
LOW…flowjs/converters/tf_saved_model_conversion_v2_test.py861 # Check if AddV2 is fused to Conv2D and Depthwise ops.
LOW…ensorflowjs/converters/tf_saved_model_conversion_v2.py81 # Set name to empty to avoid using the default name 'import'.
LOW…ensorflowjs/converters/tf_saved_model_conversion_v2.py400 # Check if any TFDF ops are used in the model.
LOW…ensorflowjs/converters/tf_saved_model_conversion_v2.py794 # Check if structure is a simple dictionary.
Cross-Language Confusion (JS/TS)2 hits · 12 pts
SeverityFileLineSnippet
HIGHtfjs-core/src/tensor.ts473 print(verbose = false): void {
HIGHtfjs-core/src/globals.ts353 * @return False if there is already a registered backend under this name, true
Cross-Language Confusion2 hits · 10 pts
SeverityFileLineSnippet
HIGH…on/tensorflowjs/converters/keras_h5_conversion_test.py503 '{"class_name": "Sequential", "keras_version": "2.2.4-tf", "config": {"layers": [{"class_name": "Dense", "config
HIGH…on/tensorflowjs/converters/keras_h5_conversion_test.py529 '{"class_name": "Sequential", "keras_version": "2.2.4-tf", "config": {"layers": [{"class_name": "UnifiedGRU", "c
AI Slop Vocabulary3 hits · 8 pts
SeverityFileLineSnippet
MEDIUM…-backend-webgpu/src/matmul_small_output_size_webgpu.ts33 // and handle some elements per thread to optimally utilize the ALU.
LOWtfjs-backend-wasm/tools/cpplint.py2572 # Here we can just use a shallow copy since we are the last
MEDIUMtfjs-react-native/src/camera/camera.ts60 // platform check to be more robust on android devices we may not have
Synthetic Comment Markers1 hit · 5 pts
SeverityFileLineSnippet
HIGH.github/workflows/tfjs-release-branch-publish-test.yml41 RELEASE: 'true' # Set RELEASE to true as requested
Fake / Example Data3 hits · 3 pts
SeverityFileLineSnippet
LOWtfjs-core/src/io/io_utils_test.ts623 const str = '_Lorem ipsum 1337!';
LOWtfjs-data/src/iterators/string_iterator_test.ts22const lorem = `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
LOWtfjs-data/src/iterators/string_iterator_test.ts22const lorem = `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippet
MEDIUM…erter/python/tensorflowjs/converters/jax_conversion.py125 # names, you can use `tree.map_structure_with_path` from the `dm-tree`
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippet
LOWtfjs-converter/python/build-pip-package.sh22# Usage: