Repository Analysis

keras-team/keras

Deep Learning for humans

23.5 Moderate AI signal View on GitHub
23.5
Adjusted Score
23.5
Raw Score
100%
Time Factor
2026-05-29
Last Push
64,073
Stars
Python
Language
322,721
Lines of Code
1011
Files
7078
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 341MEDIUM 147LOW 6590

Pattern Findings

7078 matches across 15 categories. Click a row to expand file-level details.

Unused Imports3701 hits · 2614 pts
SeverityFileLineSnippet
LOWpip_build.py29
LOWkeras/__init__.py9
LOWkeras/__init__.py10
LOWkeras/api/__init__.py7
LOWkeras/api/__init__.py8
LOWkeras/api/__init__.py9
LOWkeras/api/__init__.py10
LOWkeras/api/__init__.py11
LOWkeras/api/__init__.py12
LOWkeras/api/__init__.py13
LOWkeras/api/__init__.py14
LOWkeras/api/__init__.py15
LOWkeras/api/__init__.py16
LOWkeras/api/__init__.py17
LOWkeras/api/__init__.py18
LOWkeras/api/__init__.py19
LOWkeras/api/__init__.py20
LOWkeras/api/__init__.py21
LOWkeras/api/__init__.py22
LOWkeras/api/__init__.py23
LOWkeras/api/__init__.py24
LOWkeras/api/__init__.py25
LOWkeras/api/__init__.py26
LOWkeras/api/__init__.py27
LOWkeras/api/__init__.py28
LOWkeras/api/__init__.py29
LOWkeras/api/__init__.py30
LOWkeras/api/__init__.py31
LOWkeras/api/__init__.py32
LOWkeras/api/__init__.py33
LOWkeras/api/__init__.py34
LOWkeras/api/__init__.py35
LOWkeras/api/__init__.py36
LOWkeras/api/__init__.py37
LOWkeras/api/__init__.py38
LOWkeras/api/__init__.py39
LOWkeras/api/__init__.py40
LOWkeras/api/__init__.py41
LOWkeras/api/__init__.py42
LOWkeras/api/__init__.py43
LOWkeras/api/__init__.py46
LOWkeras/api/__init__.py49
LOWkeras/api/__init__.py50
LOWkeras/api/__init__.py53
LOWkeras/api/__init__.py54
LOWkeras/api/__init__.py55
LOWkeras/api/__init__.py56
LOWkeras/api/__init__.py57
LOWkeras/api/__init__.py58
LOWkeras/api/__init__.py59
LOWkeras/api/__init__.py60
LOWkeras/api/__init__.py61
LOWkeras/api/__init__.py62
LOWkeras/api/__init__.py63
LOWkeras/api/__init__.py64
LOWkeras/api/__init__.py65
LOWkeras/api/__init__.py66
LOWkeras/api/__init__.py67
LOWkeras/api/activations/__init__.py7
LOWkeras/api/activations/__init__.py8
3641 more matches not shown…
Hyper-Verbose Identifiers2462 hits · 2504 pts
SeverityFileLineSnippet
LOWconftest.py40def pytest_collection_modifyitems(config, items):
LOWpip_build.py69def copy_source_to_build_directory(root_path):
LOWapi_gen.py23def copy_source_to_build_directory(root_path):
LOWkeras/src/api_export.py13def register_internal_serializable(path, symbol):
LOWkeras/src/activations/activations_test.py106 def test_softmax_higher_dim_multiple_axes(self):
LOWkeras/src/activations/activations_test.py115 def test_softmax_negative_axis(self):
LOWkeras/src/activations/activations_test.py151 def test_log_softmax_higher_dim(self):
LOWkeras/src/activations/activations_test.py160 def test_log_softmax_higher_dim_multiple_axes(self):
LOWkeras/src/activations/activations_test.py169 def test_log_softmax_negative_axis(self):
LOWkeras/src/activations/activations_test.py177 def test_temporal_log_softmax(self):
LOWkeras/src/activations/activations_test.py488 def test_relu_combined_threshold_and_max_value(self):
LOWkeras/src/activations/activations_test.py497 def test_relu_combined_all_parameters(self):
LOWkeras/src/activations/activations_test.py514 def test_relu_to_trigger_leaky(self):
LOWkeras/src/visualization/plot_bounding_box_gallery.py18def plot_bounding_box_gallery(
LOW…as/src/visualization/plot_segmentation_mask_gallery.py15def plot_segmentation_mask_gallery(
LOWkeras/src/tree/dmtree_impl.py162def _recursive_flatten_with_path(path, structure, flattened):
LOWkeras/src/tree/torchtree_impl.py155 def func_with_check_without_shallow_structure(shallow, *args):
LOWkeras/src/tree/tree_test.py163 def test_is_nested_tf_wrappers(self, t):
LOWkeras/src/tree/tree_test.py430 def test_flatten_with_path_tf_wrappers(self, t):
LOWkeras/src/tree/tree_test.py588 def test_pack_sequence_as_tf_wrappers(self, t):
LOWkeras/src/tree/tree_test.py614 def test_map_structure_with_one_structure(self, t):
LOWkeras/src/tree/tree_test.py748 def test_map_structure_with_one_structure_tf_wrappers(self, t):
LOWkeras/src/tree/tree_test.py777 def test_map_structure_with_multiple_structures(self, t):
LOWkeras/src/tree/tree_test.py1105 def test_map_structure_with_multiple_structures_tf_wrappers(self, t):
LOWkeras/src/tree/tree_test.py1187 def test_assert_same_structure(self, t):
LOWkeras/src/tree/tree_test.py1542 def test_assert_same_structure_tf_wrappers(self, t):
LOWkeras/src/tree/tree_test.py1779 def test_assert_same_paths_tf_wrappers(self, t):
LOWkeras/src/tree/tree_test.py2064 def test_traverse_top_down_tf_wrappers(self, t):
LOWkeras/src/tree/tree_test.py2388 def test_traverse_bottom_up_tf_wrappers(self, t):
LOWkeras/src/tree/optree_impl.py122 def func_with_check_without_shallow_structure(shallow, *args):
LOWkeras/src/metrics/confusion_metrics_test.py727 def test_unweighted_all_correct(self):
LOWkeras/src/metrics/confusion_metrics_test.py734 def test_unweighted_high_specificity(self):
LOWkeras/src/metrics/confusion_metrics_test.py744 def test_unweighted_low_specificity(self):
LOWkeras/src/metrics/confusion_metrics_test.py829 def test_unweighted_all_correct(self):
LOWkeras/src/metrics/confusion_metrics_test.py837 def test_unweighted_high_sensitivity(self):
LOWkeras/src/metrics/confusion_metrics_test.py847 def test_unweighted_low_sensitivity(self):
LOWkeras/src/metrics/confusion_metrics_test.py54 def test_unweighted_with_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py72 def test_weighted_with_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py148 def test_unweighted_with_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py166 def test_weighted_with_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py237 def test_unweighted_with_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py255 def test_weighted_with_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py326 def test_unweighted_with_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py344 def test_weighted_with_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py407 def test_unweighted_all_incorrect(self):
LOWkeras/src/metrics/confusion_metrics_test.py436 def test_unweighted_with_threshold(self):
LOWkeras/src/metrics/confusion_metrics_test.py443 def test_weighted_with_threshold(self):
LOWkeras/src/metrics/confusion_metrics_test.py504 def test_unweighted_class_id_multiclass(self):
LOWkeras/src/metrics/confusion_metrics_test.py532 def test_unweighted_top_k_and_threshold(self):
LOWkeras/src/metrics/confusion_metrics_test.py572 def test_unweighted_all_incorrect(self):
LOWkeras/src/metrics/confusion_metrics_test.py599 def test_unweighted_with_threshold(self):
LOWkeras/src/metrics/confusion_metrics_test.py605 def test_weighted_with_threshold(self):
LOWkeras/src/metrics/confusion_metrics_test.py665 def test_unweighted_class_id_multiclass(self):
LOWkeras/src/metrics/confusion_metrics_test.py693 def test_unweighted_top_k_and_threshold(self):
LOWkeras/src/metrics/confusion_metrics_test.py784 def test_invalid_num_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py887 def test_invalid_num_thresholds(self):
LOWkeras/src/metrics/confusion_metrics_test.py913 def test_unweighted_all_correct(self):
LOWkeras/src/metrics/confusion_metrics_test.py921 def test_unweighted_high_recall(self):
LOWkeras/src/metrics/confusion_metrics_test.py932 def test_unweighted_low_recall(self):
LOWkeras/src/metrics/confusion_metrics_test.py975 def test_invalid_num_thresholds(self):
2402 more matches not shown…
Cross-File Repetition211 hits · 1055 pts
SeverityFileLineSnippet
HIGHkeras/api/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/activations/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/visualization/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/tree/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/metrics/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/losses/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/wrappers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/layers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/constraints/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/config/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/callbacks/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/quantizers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/datasets/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/datasets/mnist/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/datasets/boston_housing/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/datasets/fashion_mnist/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/datasets/reuters/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/datasets/cifar100/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/datasets/imdb/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/datasets/california_housing/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/datasets/cifar10/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/distribution/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/distillation/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/mixed_precision/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/legacy/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/legacy/saving/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/utils/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/utils/bounding_boxes/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/utils/legacy/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/backend/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/models/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/optimizers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/optimizers/legacy/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/optimizers/schedules/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/regularizers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/activations/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/visualization/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/tree/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/metrics/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/losses/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/wrappers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/layers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/constraints/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/config/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/callbacks/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/quantizers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/datasets/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/datasets/mnist/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGH…pi/_tf_keras/keras/datasets/boston_housing/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGH…api/_tf_keras/keras/datasets/fashion_mnist/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/datasets/reuters/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/datasets/cifar100/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/datasets/imdb/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGH…tf_keras/keras/datasets/california_housing/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/datasets/cifar10/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/distribution/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/distillation/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/mixed_precision/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
HIGHkeras/api/_tf_keras/keras/legacy/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.
151 more matches not shown…
Docstring Block Structure129 hits · 592 pts
SeverityFileLineSnippet
HIGHkeras/src/activations/activations.py8Applies the rectified linear unit activation function. With default values, this returns the standard ReLU activati
HIGHkeras/src/visualization/plot_bounding_box_gallery.py39Plots a gallery of images with bounding boxes. This function can display both ground truth and predicted bounding b
HIGHkeras/src/visualization/draw_bounding_boxes.py28Draws bounding boxes on images. This function draws bounding boxes on a batch of images. It supports different
HIGHkeras/src/visualization/draw_segmentation_masks.py19Draws segmentation masks on images. The function overlays segmentation masks on the input images. The masks are
HIGH…as/src/visualization/plot_segmentation_mask_gallery.py28Plots a gallery of images with corresponding segmentation masks. Args: images: A 4D tensor or NumPy array o
HIGHkeras/src/visualization/plot_image_gallery.py19Extracts a batch of images for plotting. Args: images: The 4D tensor or NumPy array of images. num_
HIGHkeras/src/tree/tree_api.py36Checks if a given structure is nested. Examples: >>> keras.tree.is_nested(42) False >>> keras.tree.is_
HIGHkeras/src/tree/tree_api.py57Traverses the given nested structure, applying the given function. The traversal is depth-first. If `top_down` is T
HIGHkeras/src/tree/tree_api.py110Flattens a possibly nested structure into a list. In the case of dict instances, the sequence consists of the value
HIGHkeras/src/tree/tree_api.py151Flattens a possibly nested structure into a list. This is a variant of flattens() which produces a list of pair
HIGHkeras/src/tree/tree_api.py177Maps `func` through given structures. Examples: >>> structure = [[1], [2], [3]] >>> keras.tree.map_structu
HIGHkeras/src/tree/tree_api.py217Maps `func` through given structures up to `shallow_structure`. This is a variant of `map_structure` which only map
HIGHkeras/src/tree/tree_api.py254Asserts that two structures are nested in the same way. This function verifies that the nested structures match. Th
HIGHkeras/src/tree/tree_api.py310Asserts that two structures have identical paths in their tree structure. This function verifies that two nested st
HIGHkeras/src/tree/tree_api.py339Returns a given flattened sequence packed into a given structure. If `structure` is an atom, `flat_sequence` must b
HIGHkeras/src/losses/losses.py2316Computes the sparse categorical crossentropy loss. Args: y_true: Ground truth values. y_pred: The p
HIGHkeras/src/layers/layer.py73This is the class from which all layers inherit. A layer is a callable object that takes as input one or more tenso
HIGHkeras/src/layers/core/einsum_dense.py945Performs int8 quantized einsum with a custom gradient. Computes the einsum operation with quantized inputs
HIGHkeras/src/layers/core/einsum_dense.py1615Parses an einsum string to determine the shapes of the weights. This function is the main entry point for analyzing
HIGHkeras/src/layers/core/einsum_dense.py1682Computes kernel and bias shapes from a parsed einsum equation. This function takes the components of an einsum equa
HIGHkeras/src/layers/convolutional/depthwise_conv2d.py72D depthwise convolution layer. Depthwise convolution is a type of convolution in which each input channel is c
HIGHkeras/src/layers/convolutional/depthwise_conv1d.py71D depthwise convolution layer. Depthwise convolution is a type of convolution in which each input channel is c
HIGHkeras/src/layers/convolutional/conv3d_transpose.py123D transposed convolution layer. The need for transposed convolutions generally arise from the desire to use a
HIGHkeras/src/layers/convolutional/conv1d.py81D convolution layer (e.g. temporal convolution). This layer creates a convolution kernel that is convolved with th
HIGHkeras/src/layers/convolutional/conv2d_transpose.py122D transposed convolution layer. The need for transposed convolutions generally arise from the desire to use a
HIGHkeras/src/layers/convolutional/conv3d.py73D convolution layer. This layer creates a convolution kernel that is convolved with the layer input over a 3D
HIGHkeras/src/layers/convolutional/conv2d.py72D convolution layer. This layer creates a convolution kernel that is convolved with the layer input over a 2D
HIGHkeras/src/layers/convolutional/conv1d_transpose.py121D transposed convolution layer. The need for transposed convolutions generally arise from the desire to use a
HIGHkeras/src/layers/preprocessing/stft_spectrogram.py14Layer to compute the Short-Time Fourier Transform (STFT) on a 1D signal. A layer that computes Spectrograms of the
HIGH…ssing/image_preprocessing/bounding_boxes/converters.py14Converts bounding boxes between formats. Supported formats (case-insensitive): `"xyxy"`: [left, top, right, bot
HIGH…ssing/image_preprocessing/bounding_boxes/converters.py265Encodes bounding boxes relative to anchors as deltas. This function calculates the deltas that represent the differ
HIGH…ssing/image_preprocessing/bounding_boxes/converters.py357Converts bounding boxes from delta format to the specified `box_format`. This function decodes bounding box deltas
HIGHkeras/src/layers/merging/concatenate.py10Concatenates a list of inputs. It takes as input a list of tensors, all of the same shape except for the concat
HIGHkeras/src/layers/merging/add.py42Functional interface to the `keras.layers.Add` layer. Args: inputs: A list of input tensors with the same s
HIGHkeras/src/layers/merging/subtract.py53Functional interface to the `keras.layers.Subtract` layer. Args: inputs: A list of input tensors of size 2,
HIGHkeras/src/layers/merging/multiply.py63Functional interface to the `keras.layers.Multiply` layer. Args: inputs: A list of input tensors , all of t
HIGHkeras/src/layers/merging/maximum.py39Functional interface to the `keras.layers.Maximum` layer. Args: inputs: A list of input tensors , all of th
HIGHkeras/src/layers/merging/minimum.py39Functional interface to the `keras.layers.Minimum` layer. Args: inputs: A list of input tensors , all of th
HIGHkeras/src/layers/merging/average.py42Functional interface to the `keras.layers.Average` layer. Args: inputs: A list of input tensors , all of th
HIGHkeras/src/layers/merging/base_merge.py61Computes the shape of the resultant of an elementwise operation. Args: shape1: Tuple or None. Shape
HIGHkeras/src/callbacks/tensorboard_test.py65Read all summaries under the logdir into a `_SummaryFile`. Args: logdir: A path to a directory that contains
HIGHkeras/src/callbacks/tensorboard.py654Writes a Keras model as JSON to as a Summary. Writing the Keras model configuration allows the TensorBoard graph pl
HIGHkeras/src/quantizers/awq_core.py194Get group size from config or dtype policy. Args: layer: The layer to get group size for. config: O
HIGHkeras/src/quantizers/gptq_core.py369Determine the group size for GPTQ quantization. The group size can be specified either through the `config` argumen
HIGHkeras/src/quantizers/gptq_core.py410Determine the number of weight bits for GPTQ quantization. The number of weight bits can be specified either throug
HIGHkeras/src/distribution/distribution_lib.py394Create a distributed dataset from the original global dataset. Args: dataset: the original global d
HIGHkeras/src/distillation/distiller.py11Distillation model for transferring knowledge from teacher to student. Knowledge distillation transfers knowledge f
HIGHkeras/src/legacy/preprocessing/image.py1384Applies a transformation to an image according to given parameters. Args: x: 3D tensor, single imag
HIGHkeras/src/legacy/preprocessing/image.py1704Performs a brightness shift. DEPRECATED. Args: x: Input tensor. Must be 3D. brightness: Float.
HIGHkeras/src/legacy/preprocessing/image.py1735Performs a random brightness shift. DEPRECATED. Args: x: Input tensor. Must be 3D. brightness_
HIGHkeras/src/legacy/saving/saving_utils.py24Instantiates a Keras model from its config. Args: config: Configuration dictionary. custom_objects:
HIGHkeras/src/legacy/saving/json_utils.py134Serializes any object to a JSON-serializable structure. Args: obj: the object to serialize Returns:
HIGHkeras/src/legacy/saving/legacy_h5_format.py81Loads a model saved via `save_model_to_hdf5`. Args: filepath: One of the following: - String, p
HIGHkeras/src/legacy/saving/legacy_h5_format.py577Load layer weights of a model from hdf5. Args: group: HDF5 group. Returns: List of NumPy array
HIGHkeras/src/backend/config.py46Set the default float dtype. Note: It is not recommended to set this to `"float16"` for training, as this will
HIGHkeras/src/backend/common/variables.py16Represents a backend-agnostic variable in Keras. A `Variable` acts as a container for state. It holds a tensor valu
HIGHkeras/src/backend/common/dtypes.py282Returns the type from applying the Keras type promotion rules. In general, each argument is first parsed by `backen
HIGHkeras/src/backend/jax/nn.py1580Applies a wrapped flash attention mechanism using the Splash kernel. This function prepares the appropriate attentio
HIGHkeras/src/optimizers/multi_optimizer.py37Retrieves the corresponding `Optimizer` by the string key. This method first attempts an exact key match. If no
HIGH…ras/src/optimizers/schedules/learning_rate_schedule.py189A `LearningRateSchedule` that uses a piecewise constant decay schedule. The function returns a 1-arg callable to co
69 more matches not shown…
Deep Nesting290 hits · 280 pts
SeverityFileLineSnippet
LOWconftest.py14
LOWapi_gen.py36
LOWkeras/src/visualization/draw_bounding_boxes.py17
LOWkeras/src/tree/dmtree_impl.py162
LOWkeras/src/tree/dmtree_impl.py244
LOWkeras/src/tree/torchtree_impl.py99
LOWkeras/src/losses/loss_test.py177
LOWkeras/src/losses/loss.py56
LOWkeras/src/layers/input_spec.py122
LOWkeras/src/layers/layer.py875
LOWkeras/src/layers/layer.py1375
LOWkeras/src/layers/layer.py1763
LOWkeras/src/layers/layer.py1889
LOWkeras/src/layers/activations/softmax.py55
LOW…s/src/layers/attention/grouped_query_attention_test.py106
LOWkeras/src/layers/attention/multi_head_attention_test.py113
LOWkeras/src/layers/reshaping/cropping3d.py125
LOWkeras/src/layers/reshaping/cropping2d.py145
LOWkeras/src/layers/core/embedding.py261
LOWkeras/src/layers/core/embedding.py303
LOWkeras/src/layers/core/dense.py159
LOWkeras/src/layers/core/dense.py297
LOWkeras/src/layers/core/dense.py334
LOWkeras/src/layers/core/dense.py454
LOWkeras/src/layers/core/dense.py1031
LOWkeras/src/layers/core/einsum_dense.py238
LOWkeras/src/layers/core/einsum_dense.py380
LOWkeras/src/layers/core/einsum_dense.py417
LOWkeras/src/layers/core/einsum_dense.py543
LOWkeras/src/layers/core/einsum_dense.py584
LOWkeras/src/layers/core/einsum_dense.py700
LOWkeras/src/layers/core/einsum_dense.py1267
LOWkeras/src/layers/core/reversible_embedding.py383
LOWkeras/src/layers/convolutional/conv_transpose_test.py178
LOWkeras/src/layers/preprocessing/index_lookup.py645
LOWkeras/src/layers/preprocessing/index_lookup.py844
LOWkeras/src/layers/preprocessing/hashed_crossing.py138
LOWkeras/src/layers/preprocessing/discretization.py159
LOWkeras/src/layers/preprocessing/text_vectorization.py393
LOWkeras/src/layers/preprocessing/text_vectorization.py563
LOWkeras/src/layers/preprocessing/stft_spectrogram.py290
LOWkeras/src/layers/preprocessing/normalization.py251
LOWkeras/src/layers/preprocessing/feature_space.py386
LOWkeras/src/layers/preprocessing/feature_space.py462
LOWkeras/src/layers/preprocessing/feature_space.py493
LOWkeras/src/layers/preprocessing/feature_space.py580
LOWkeras/src/layers/preprocessing/feature_space.py712
LOW…ayers/preprocessing/image_preprocessing/center_crop.py184
LOW…ssing/image_preprocessing/bounding_boxes/validation.py24
LOW…ssing/image_preprocessing/bounding_boxes/validation.py118
LOWkeras/src/layers/merging/base_merge.py60
LOWkeras/src/layers/merging/base_merge.py143
LOWkeras/src/layers/rnn/bidirectional.py199
LOWkeras/src/layers/rnn/bidirectional.py309
LOWkeras/src/layers/rnn/bidirectional.py415
LOWkeras/src/layers/rnn/lstm.py529
LOWkeras/src/layers/rnn/gru.py547
LOWkeras/src/callbacks/callback_list.py59
LOWkeras/src/callbacks/swap_ema_weights.py116
LOWkeras/src/callbacks/reduce_lr_on_plateau.py99
230 more matches not shown…
Self-Referential Comments103 hits · 274 pts
SeverityFileLineSnippet
MEDIUMkeras/src/activations/activations_test.py460 # Define the input tensor
MEDIUMkeras/src/activations/activations_test.py471 # Define the input tensor
MEDIUMkeras/src/activations/activations_test.py480 # Define the input tensor
MEDIUMkeras/src/activations/activations_test.py489 # Define the input tensor
MEDIUMkeras/src/activations/activations_test.py498 # Define the input tensor
MEDIUMkeras/src/layers/layer.py161 # Create the state of the layer (weights)
MEDIUMkeras/src/layers/layer.py201 # Create a non-trainable weight.
MEDIUMkeras/src/layers/layer_test.py189 # Create a mock to track calls to remat
MEDIUMkeras/src/layers/layer_test.py983 # Create an input tensor WITHOUT an attached mask.
MEDIUMkeras/src/layers/layer_test.py987 # Create a mask to be passed explicitly.
MEDIUMkeras/src/layers/preprocessing/text_vectorization.py172 >>> # Create the layer.
MEDIUMkeras/src/layers/preprocessing/text_vectorization.py194 >>> # Create the layer, passing the vocab directly. You can also pass the
MEDIUMkeras/src/layers/preprocessing/discretization_test.py406 # Create a KerasTensor input
MEDIUM…/src/layers/preprocessing/image_preprocessing/clahe.py58 # Create a CLAHE layer with default parameters
MEDIUM…yers/preprocessing/image_preprocessing/equalization.py48 # Create an equalization layer for standard 8-bit images
MEDIUMkeras/src/callbacks/orbax_checkpoint_test.py220 # Create a new model with the same architecture
MEDIUMkeras/src/callbacks/orbax_checkpoint.py171 # Create the V1 Checkpointer with direct parameter passing
MEDIUMkeras/src/callbacks/model_checkpoint.py37 # Define a learning rate schedule
MEDIUMkeras/src/callbacks/model_checkpoint.py97 # Define a learning rate schedule
MEDIUMkeras/src/quantizers/quantizers_test.py146 # Create a random tensor with int4 values in the specified range and
MEDIUMkeras/src/quantizers/quantizers_test.py552 # Define the function to compute gradients for
MEDIUMkeras/src/quantizers/awq.py281 # Create a temporary object that holds a reshaped 2D version
MEDIUMkeras/src/quantizers/gptq.py313 # Create a temporary object that holds a reshaped
MEDIUMkeras/src/distribution/distribution_lib.py573 # Create a mesh with 2 devices for data parallelism and 4 devices for
MEDIUMkeras/src/distribution/distribution_lib.py577 # Create a layout map that shard the `Dense` layer and `Conv2D`
MEDIUMkeras/src/distillation/distiller_test.py130 # Create a new teacher that is trainable and verify it gets frozen
MEDIUMkeras/src/utils/config.py26 # Create a config via constructor arguments
MEDIUMkeras/src/utils/file_utils_test.py129 # Creating a TarInfo-like object with a name attribute
MEDIUMkeras/src/utils/summary_utils.py351 # Create a rich console for printing. Capture for non-interactive logging.
MEDIUMkeras/src/backend/openvino/core.py1322 # Create a zeros tensor of the target shape.
MEDIUMkeras/src/backend/openvino/numpy.py1351 # Create a slice of zeros with the same type as x
MEDIUMkeras/src/backend/openvino/trainer.py242 # Create an iterator that yields batches of input data.
MEDIUMkeras/src/backend/torch/nn.py379 # Create a real tensor to execute the ops.
MEDIUMkeras/src/backend/torch/trainer.py207 # Create the validation data using the training data. Only supported
MEDIUMkeras/src/backend/torch/trainer.py224 # Create an iterator that yields batches for one epoch.
MEDIUMkeras/src/backend/torch/trainer.py351 # Create an iterator that yields batches of input/target data.
MEDIUMkeras/src/backend/torch/trainer.py401 # Create an iterator that yields batches of input data.
MEDIUMkeras/src/backend/numpy/trainer.py176 # Create an iterator that yields batches of input data.
MEDIUMkeras/src/backend/numpy/trainer.py246 # Create an iterator that yields batches of input/target data.
MEDIUMkeras/src/backend/common/remat.py175 # Define a simple model using the custom layer
MEDIUMkeras/src/backend/common/name_scope_test.py55 # Create a name_scope instance
MEDIUMkeras/src/backend/common/name_scope_test.py72 # Create a name_scope instance
MEDIUMkeras/src/backend/common/name_scope_test.py118 # Create a name_scope but don't enter it
MEDIUMkeras/src/backend/common/remat_test.py118 # Define a function that uses keyword arguments
MEDIUMkeras/src/backend/common/variables_test.py1277 # Create a mock SymInt object
MEDIUMkeras/src/backend/common/symbolic_scope_test.py11 # Define a function that behaves differently according to
MEDIUMkeras/src/backend/tensorflow/numpy.py3624 # Create a smaller square eye and pad appropriately.
MEDIUMkeras/src/backend/tensorflow/trainer.py343 # Create the validation data using the training data. Only supported
MEDIUMkeras/src/backend/tensorflow/trainer.py359 # Create an iterator that yields batches for one epoch.
MEDIUMkeras/src/backend/tensorflow/trainer.py477 # Create an iterator that yields batches of input/target data.
MEDIUMkeras/src/backend/tensorflow/trainer.py526 # Create an iterator that yields batches of input data.
MEDIUMkeras/src/backend/jax/core.py414 # Create a _DimExpr instance for one dimension by creating a symbolic
MEDIUMkeras/src/backend/jax/trainer.py50 """This method is stateless and is intended for use with jax.grad."""
MEDIUMkeras/src/backend/jax/trainer.py390 # Create the validation data using the training data. Only supported
MEDIUMkeras/src/backend/jax/trainer.py406 # Create an iterator that yields batches for one epoch.
MEDIUMkeras/src/backend/jax/trainer.py571 # Create an iterator that yields batches of
MEDIUMkeras/src/backend/jax/trainer.py656 # Create an iterator that yields batches of input data.
MEDIUMkeras/src/models/cloning.py81 # Create a test Sequential model.
MEDIUMkeras/src/models/cloning.py87 # Create a copy of the test model (with freshly initialized weights).
MEDIUMkeras/src/models/model.py504 # Create a custom config
43 more matches not shown…
Decorative Section Separators18 hits · 69 pts
SeverityFileLineSnippet
MEDIUMkeras/src/backend/jax/trainer_test.py33 # ----------------------------------------------------------------
MEDIUMkeras/src/backend/jax/trainer_test.py35 # ----------------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py458 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py460 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py469 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py471 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py574 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py576 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py579 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py581 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py488 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py490 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py517 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py519 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py540 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py542 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py561 # ------------------------------------------------------
MEDIUMkeras/src/saving/file_editor.py563 # ------------------------------------------------------
Excessive Try-Catch Wrapping53 hits · 56 pts
SeverityFileLineSnippet
LOWkeras/src/wrappers/sklearn_test.py157 except Exception as exc:
LOWkeras/src/wrappers/sklearn_test.py211 except Exception as exc:
LOWkeras/src/layers/layer.py256 except Exception:
LOWkeras/src/layers/layer.py1568 except Exception as e:
LOWkeras/src/layers/normalization/group_normalization.py119 except Exception:
LOWkeras/src/callbacks/orbax_checkpoint_test.py435 except Exception:
LOWkeras/src/callbacks/orbax_checkpoint.py357 except Exception:
LOWkeras/src/callbacks/tensorboard.py632 except Exception as e:
LOWkeras/src/callbacks/tensorboard.py646 except Exception as e:
LOWkeras/src/callbacks/tensorboard.py688 except Exception as exc:
LOWkeras/src/utils/traceback_utils.py118 except Exception as e:
LOWkeras/src/utils/traceback_utils.py157 except Exception as e:
LOWkeras/src/backend/openvino/core.py627 except Exception as e:
LOWkeras/src/backend/openvino/core.py889 except Exception as e:
LOWkeras/src/backend/openvino/core.py931 except Exception:
LOWkeras/src/backend/openvino/core.py949 except Exception as inner_exception:
MEDIUMkeras/src/backend/openvino/core.py623def __array__(self, dtype=None):
LOWkeras/src/backend/openvino/numpy.py271 except Exception:
LOWkeras/src/backend/openvino/numpy.py690 except Exception:
LOWkeras/src/backend/openvino/numpy.py2623 except Exception as e:
LOWkeras/src/backend/torch/core.py189 except Exception:
MEDIUMkeras/src/backend/torch/core.py186def __eq__(self, other):
LOWkeras/src/backend/torch/rnn.py617 except Exception:
LOWkeras/src/backend/torch/rnn.py807 except Exception:
LOWkeras/src/backend/common/variables.py635 except Exception as e:
LOWkeras/src/backend/jax/nn.py1793 except Exception:
LOWkeras/src/backend/jax/nn.py1815 except Exception:
LOWkeras/src/trainers/trainer.py1121 except Exception as e:
LOWkeras/src/trainers/data_adapters/py_dataset_adapter.py639 except Exception as e:
LOWkeras/src/trainers/data_adapters/py_dataset_adapter.py672 except Exception as e:
LOWkeras/src/dtype_policies/dtype_policy_map.py229 except Exception:
LOWkeras/src/ops/numpy.py7060 except Exception:
LOWkeras/src/ops/operation.py102 except Exception as e:
LOWkeras/src/ops/operation.py318 except Exception as e:
MEDIUMkeras/src/ops/operation.py99def compute_output_spec(self, *args, **kwargs):
LOWkeras/src/ops/linalg.py47 except Exception as e:
LOWkeras/src/ops/linalg.py93 except Exception as e:
LOWkeras/src/saving/saving_lib.py692 except Exception:
LOWkeras/src/saving/saving_lib.py799 except Exception as e:
LOWkeras/src/saving/saving_lib.py811 except Exception as e:
LOWkeras/src/export/openvino_test.py110 except Exception as e:
LOWkeras/src/export/openvino_test.py165 except Exception as e:
LOWkeras/src/export/openvino_test.py200 except Exception as e:
LOWkeras/src/export/openvino_test.py233 except Exception as e:
LOWkeras/src/export/onnx.py245 except Exception:
LOWkeras/src/export/tf2onnx_lib.py129 except Exception as ex:
LOWkeras/src/export/torch.py100 except Exception as e:
LOWkeras/src/export/litert.py245 except Exception as e:
LOWintegration_tests/pytorch_export_test.py102 except Exception as e:
LOWintegration_tests/pytorch_export_test.py163 except Exception as e:
LOWintegration_tests/pytorch_export_test.py179 except Exception as e:
LOWintegration_tests/pytorch_export_test.py246 except Exception as e:
LOWintegration_tests/pytorch_export_test.py297 except Exception as e:
Redundant / Tautological Comments27 hits · 40 pts
SeverityFileLineSnippet
LOWkeras/src/tree/dmtree_impl.py207 # Check if the reference entry (first one) is None
LOWkeras/src/tree/torchtree_impl.py134 # Check if the reference entry (first one) is None
LOWkeras/src/layers/core/embedding.py293 # Check if the attribute exists on the instance before saving.
LOWkeras/src/layers/core/embedding.py327 # Check if the attribute exists before attempting to assign.
LOWkeras/src/layers/core/einsum_dense.py1339 # Assign values to the newly created variables.
LOWkeras/src/layers/normalization/batch_normalization.py335 # Check if the mask has one less dimension than the inputs.
LOWkeras/src/layers/rnn/time_distributed.py79 # Check if mask has at least 2 dimensions (batch and timesteps)
LOWkeras/src/callbacks/orbax_checkpoint.py196 # Check if JAX distributed client is initialized
LOWkeras/src/distillation/distiller_test.py101 # Check if the model has been compiled (different backends may handle
LOWkeras/src/legacy/saving/serialization.py362 # Check if `cls_config` is a list. If it is a list, return the class and the
LOWkeras/src/utils/image_utils.py287 # Set back to input height / width
LOWkeras/src/utils/image_utils.py401 # Set back to input height / width if crop_height / crop_width is not
LOWkeras/src/backend/openvino/numpy.py2987 # Check if k is odd
LOWkeras/src/backend/torch/rnn.py433 # Check if mask is valid for cuDNN
LOWkeras/src/backend/jax/nn.py1480 # Check if cuDNN is installed and raise RuntimeError if cuDNN is not
LOWkeras/src/models/model.py809 # Check if LiteRT export is available (requires TensorFlow or
LOWkeras/src/models/model.py819 # Check if Torch export is available (requires PyTorch backend)
LOWkeras/src/dtype_policies/dtype_policy.py604 # Check if mode has block_size component (e.g., "int4/128")
LOWkeras/src/ops/ops_test.py56 # Check if that function exist. Some classes are abstract super
LOWkeras/src/ops/function.py134 # Check if input shapes are identical to ref input shapes,
LOWkeras/src/saving/file_editor.py29 # Check if an active IPython shell exists.
LOWkeras/src/saving/serialization_lib_test.py446 # Check if it resolves to the canonical keras activation function
LOWkeras/src/export/onnx.py249 # Set verbose to False for TorchScript due to file system leakage
LOWintegration_tests/dataset_tests/imdb_test.py35 # Check if top 10 words are skipped properly
LOWintegration_tests/dataset_tests/imdb_test.py46 # Check if word_index contains specific known words
LOWintegration_tests/dataset_tests/reuters_test.py43 # Check if word_index contains specific known words
LOWintegration_tests/dataset_tests/reuters_test.py49 # Check if the tuple contains specific known labels
Over-Commented Block42 hits · 36 pts
SeverityFileLineSnippet
LOWkeras/src/tree/dmtree_impl.py1import collections
LOWkeras/src/metrics/confusion_metrics_test.py1161 # without sample_weight:
LOWkeras/src/metrics/confusion_metrics_test.py1561 # tn = [[0, 1, 2, 2, 2], [0, 2, 2, 2, 2]]
LOWkeras/src/metrics/metrics_utils.py141 = ops.floor([0.2, 1.0, 0.6, 1.8])
LOWkeras/src/layers/layer.py921 ############################################
LOWkeras/src/layers/preprocessing/hashing_test.py441
LOWkeras/src/layers/preprocessing/hashing_test.py461# # Same hashed output as test_hash_sparse_input_farmhash
LOWkeras/src/layers/preprocessing/hashing_test.py481# empty_mask_output = empty_mask_layer(inp_data)
LOWkeras/src/layers/preprocessing/hashing_test.py501# self.assertAllClose(expected_output[1], out_data[1])
LOWkeras/src/layers/preprocessing/hashing_test.py521
LOWkeras/src/layers/preprocessing/hashing_test.py541# # Same hashed output as test_hash_sparse_input_farmhash
LOWkeras/src/layers/preprocessing/feature_space.py521 for name in self._list_adaptable_preprocessors():
LOW…/preprocessing/image_preprocessing/center_crop_test.py181 # np.random.rand(10, 10, 3),
LOWkeras/src/callbacks/callback.py81
LOWkeras/src/callbacks/tensorboard_test.py521 # self.assertEqual(
LOWkeras/src/callbacks/tensorboard_test.py701 # Dense(1),
LOWkeras/src/callbacks/tensorboard_test.py721
LOWkeras/src/distribution/distribution_lib_test.py561# # Config virtual devices for testing.
LOWkeras/src/distribution/distribution_lib_test.py581# shape = (4, 2)
LOWkeras/src/distribution/distribution_lib_test.py601# dtensor.Layout(["data", dtensor.UNSHARDED], dtensor_mesh),
LOWkeras/src/utils/model_visualization.py361 # No nesting, connect directly.
LOWkeras/src/backend/torch/numpy.py181
LOWkeras/src/backend/common/dtypes.py121 Returns:
LOWkeras/src/backend/tensorflow/random.py141 dtype,
LOWkeras/src/backend/tensorflow/rnn.py901 # after batch dim for time major or batch major inputs respectively
LOWkeras/src/optimizers/optimizer_sparse_test.py141 ):
LOWkeras/src/trainers/data_adapters/array_data_adapter.py121 # 2. parallelized map
LOWkeras/src/saving/saving_lib_test.py441 self.assertIn("date_saved", metadata)
LOWintegration_tests/model_visualization_test.py321 # | sub (Sequential) |
LOWintegration_tests/model_visualization_test.py381 edge_dict = get_edge_dict(model_to_dot(model))
LOWintegration_tests/model_visualization_test.py401 # | v |
LOWintegration_tests/model_visualization_test.py441 keras.layers.Dense(10, name="dense1"),
LOWintegration_tests/model_visualization_test.py481 # | | inner v | |
LOWintegration_tests/model_visualization_test.py521 model = keras.models.Sequential(
LOWintegration_tests/model_visualization_test.py561 # | mid | |
LOWintegration_tests/model_visualization_test.py601
LOWintegration_tests/model_visualization_test.py641 # | +-------------------------+ |
LOWintegration_tests/model_visualization_test.py721 )
LOWintegration_tests/model_visualization_test.py741 {
LOWintegration_tests/model_visualization_test.py761 # | | | dense0 | | | |inner_inp1t| |inner_inp2t| | | subclass3 | |
LOWexamples/demo_jax_distributed.py181# Use Keras APIs to find the variable of a specific layer (we will be sharding this one in a special way)
LOW.github/workflows/labeler.yaml1# Copyright 2024 Google LLC. All Rights Reserved.
AI Slop Vocabulary16 hits · 36 pts
SeverityFileLineSnippet
LOWkeras/src/activations/__init__.py101 # Case for keras.activations builtins (simply return name)
MEDIUMkeras/src/metrics/confusion_metrics.py1493 # Due to the hyperbolic transform, this formula is less robust than
LOWkeras/src/layers/normalization/batch_normalization.py27 # If we get a string or dict, just return as we cannot and should not clone.
MEDIUMkeras/src/layers/rnn/lstm.py548 # TF for instance, it will leverage cuDNN when feasible, and
MEDIUMkeras/src/layers/rnn/gru.py566 # TF for instance, it will leverage cuDNN when feasible, and
MEDIUMkeras/src/callbacks/orbax_checkpoint_test.py547 """Test comprehensive model state restoration with exact weight
MEDIUMkeras/src/callbacks/early_stopping_test.py282 # in conjunction with 'start_from_epoch'.
LOWkeras/src/legacy/saving/serialization.py241 # already serialized this config. If so, just use that config. This will
LOWkeras/src/utils/text_dataset_utils_test.py72 # We just return the texts, no labels
LOWkeras/src/backend/openvino/numpy.py2370 # that ever changes, we could simplify this to just call that operation.
LOWkeras/src/backend/openvino/linalg.py594 # If not continue_cond, just return A_curr and V_curr
MEDIUMkeras/src/backend/torch/core.py357 # more robust, but more expensive.
MEDIUMkeras/src/backend/tensorflow/numpy.py333 # Replace tf.einsum with custom ops to utilize hardware-accelerated
MEDIUMkeras/src/backend/tensorflow/numpy.py3729 # unfortunately we can't leverage 'SAME' padding directly like
LOWkeras/src/trainers/data_adapters/py_dataset_adapter.py707 # If a worker dies during init, the pool will just create a replacement.
MEDIUMkeras/src/ops/function.py155 # Wrap `input_shape` into the structure of KerasTensor to utilize
Slop Phrases15 hits · 22 pts
SeverityFileLineSnippet
MEDIUMkeras/src/layers/preprocessing/text_vectorization.py182 >>> # Now, the layer can map strings to integers -- you can use an
MEDIUMkeras/src/constraints/constraints.py17 Here's a simple example of a non-negative weight constraint:
MEDIUMkeras/src/utils/dataset_utils.py63 >>> # For a tf.data.Dataset, you can use .cardinality()
MEDIUMkeras/src/utils/dataset_utils.py66 >>> # For a torch.utils.data.Dataset, you can use len()
MEDIUMkeras/src/initializers/initializer.py34 Here's a simple example: a random normal initializer.
MEDIUMguides/custom_train_step_in_torch.py210# Just use `fit` as usual -- you can use callbacks, etc.
MEDIUMguides/understanding_masking_and_padding.py335Here's a simple example below: a layer that computes a softmax over the time dimension
LOWguides/writing_a_custom_training_loop_in_torch.py119Also, don't forget to call `model.zero_grad()` before `loss.backward()`, or you won't
MEDIUMguides/distributed_training_with_tensorflow.py184Here's a simple example:
MEDIUMguides/custom_train_step_in_tensorflow.py195# Just use `fit` as usual -- you can use callbacks, etc.
MEDIUMguides/custom_train_step_in_jax.py283# Just use `fit` as usual -- you can use callbacks, etc.
MEDIUMguides/training_with_built_in_methods.py315Here's a simple example showing how to implement a `CategoricalTruePositives` metric
MEDIUMguides/training_with_built_in_methods.py362(the one passed to `compile()`). Here's a simple example that adds activity
MEDIUMguides/training_with_built_in_methods.py1075Here's a simple example saving a list of per-batch loss values during training:
MEDIUMguides/functional_api.py60# Just for demonstration purposes.
Verbosity Indicators7 hits · 10 pts
SeverityFileLineSnippet
LOWkeras/src/layers/core/dense.py1167 # Step 1: Dequantize kernel to float
LOWkeras/src/layers/core/dense.py1200 # Step 2: Merge LoRA weights in float domain
LOWkeras/src/layers/core/dense.py1206 # Step 3: Re-quantize the merged kernel
LOWkeras/src/quantizers/awq.py174 # Step 1: Find optimal AWQ scales via grid search
LOWkeras/src/quantizers/awq.py182 # Step 2: Apply AWQ scales by MULTIPLYING (expand salient weights)
LOWkeras/src/saving/saving_api.py402 # Step 1: Load model_config to rebuild the model.
LOWkeras/src/saving/saving_api.py420 # Step 2: Load pytree (arrays) with optional resharding.
Cross-Language Confusion1 hit · 8 pts
SeverityFileLineSnippet
HIGHkeras/src/tree/dmtree_impl.py24# non-sortable keys as unsupported (meaning behavior is undefined).
Overly Generic Function Names3 hits · 3 pts
SeverityFileLineSnippet
LOWkeras/src/utils/python_utils_test.py10 def my_function(x, y=1, **kwargs):
LOWkeras/src/backend/jax/distribution_lib_test.py99 def test_function(inputs, target_layout):
LOWkeras/src/backend/jax/distribution_lib_test.py125 def test_function(inputs, target_layout):