repo
stringlengths
1
99
file
stringlengths
13
215
code
stringlengths
12
59.2M
file_length
int64
12
59.2M
avg_line_length
float64
3.82
1.48M
max_line_length
int64
12
2.51M
extension_type
stringclasses
1 value
lightning
lightning-master/src/lightning/app/cli/pl-app-template/core/components/script_runner/script_runner.py
import sys import traceback from typing import Any, Dict, List, Optional, Tuple from lightning.app.components.python import TracerPythonScript from lightning.app.storage import Path from lightning.app.utilities.packaging.build_config import BuildConfig, load_requirements from lightning.app.utilities.tracer import Trac...
3,193
39.43038
118
py
lightning
lightning-master/src/lightning/app/cli/pl-app-template/tests/core/test_callbacks.py
import os.path from unittest.mock import Mock import pytest from core.callbacks import PLAppArtifactsTracker, PLAppProgressTracker, PLAppSummary from core.components.script_runner import ScriptRunner from lightning.app.storage import Path from lightning.pytorch import LightningModule, Trainer from lightning.pytorch.l...
2,519
35
106
py
lightning
lightning-master/src/lightning/app/testing/helpers.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
5,222
29.366279
102
py
lightning
lightning-master/src/lightning/app/utilities/introspection.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
11,480
28.139594
115
py
lightning
lightning-master/src/lightning/app/utilities/imports.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
3,980
25.898649
117
py
lightning
lightning-master/src/lightning/app/utilities/packaging/build_config.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
7,631
36.229268
116
py
lightning
lightning-master/src/lightning/app/components/training.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
7,242
34.679803
96
py
lightning
lightning-master/src/lightning/app/components/serve/python_server.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
11,359
32.510324
120
py
lightning
lightning-master/src/lightning/app/components/serve/types/image.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
1,514
31.934783
82
py
lightning
lightning-master/src/lightning/app/components/multi_node/base.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
3,923
35
112
py
lightning
lightning-master/src/lightning/app/components/multi_node/fabric.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
4,657
34.022556
109
py
lightning
lightning-master/src/lightning/app/components/multi_node/pytorch_spawn.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
4,159
33.666667
119
py
lightning
lightning-master/src/lightning/app/components/multi_node/__init__.py
from lightning.app.components.multi_node.base import MultiNode from lightning.app.components.multi_node.fabric import FabricMultiNode from lightning.app.components.multi_node.pytorch_spawn import PyTorchSpawnMultiNode from lightning.app.components.multi_node.trainer import LightningTrainerMultiNode __all__ = ["FabricM...
398
56
96
py
lightning
lightning-master/src/lightning/app/components/multi_node/trainer.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
4,741
35.198473
116
py
lightning
lightning-master/src/lightning/store/save.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
11,410
36.413115
119
py
lightning
lightning-master/src/lightning/store/cloud_api.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
14,753
36.928021
116
py
lightning
lightning-master/src/lightning/data/fileio.py
import os from typing import Any, Dict, Optional, TYPE_CHECKING if TYPE_CHECKING: try: from torchdata.datapipes.utils import StreamWrapper except ImportError: StreamWrapper = object def is_url(path: str) -> bool: return path.startswith("s3://") def is_path(path: str) -> bool: return...
3,849
29.314961
106
py
lightning
lightning-master/src/lightning/data/datasets/base.py
from typing import Any, Literal from torch.utils.data import Dataset as TorchDataset from lightning.data.backends import _DatasetBackend, LocalDatasetBackend, S3DatasetBackend from lightning.data.fileio import OpenCloudFileObj class _Dataset(TorchDataset): """Base dataset class for streaming data from a cloud s...
1,312
33.552632
109
py
lightning
lightning-master/src/lightning/data/datasets/iterable.py
import math import warnings from abc import ABC, abstractmethod from copy import deepcopy from typing import Any, Dict, Generator, List, Literal, Optional, Protocol, runtime_checkable, Sequence, Tuple import torch from torch.utils.data import DataLoader as _DataLoader from torch.utils.data import IterableDataset from...
18,582
40.759551
120
py
lightning
lightning-master/src/lightning/data/datasets/env.py
from typing import Optional import torch from torch.utils.data import get_worker_info class _DistributedEnv: """The environment of the distributed training. Args: world_size: The number of total distributed training processes global_rank: The rank of the current process within this pool of t...
5,461
35.905405
120
py
lightning
lightning-master/src/lightning/data/datasets/index.py
import math import os from io import TextIOWrapper from lightning.app.utilities.network import LightningClient def get_index(s3_connection_path: str, index_file_path: str) -> bool: """Creates an index of file paths that are in the provided s3 path. Returns: Returns True is the index got created and ...
4,767
33.80292
119
py
lightning
lightning-master/src/lightning/pytorch/cli.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
36,409
47.806971
120
py
lightning
lightning-master/src/lightning/pytorch/__init__.py
"""Root package info.""" import logging import os from lightning_utilities import module_available if os.path.isfile(os.path.join(os.path.dirname(__file__), "__about__.py")): from lightning.pytorch.__about__ import * # noqa: F401, F403 if "__version__" not in locals(): if os.path.isfile(os.path.join(os.path...
2,493
35.676471
94
py
lightning
lightning-master/src/lightning/pytorch/trainer/setup.py
# Copyright Lightning AI. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
8,857
42
120
py
lightning
lightning-master/src/lightning/pytorch/trainer/call.py
# Copyright Lightning AI. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
11,847
37.592834
115
py
lightning
lightning-master/src/lightning/pytorch/trainer/configuration_validator.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
9,315
51.044693
120
py
lightning
lightning-master/src/lightning/pytorch/trainer/__init__.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
745
36.3
74
py
lightning
lightning-master/src/lightning/pytorch/trainer/states.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
2,894
31.166667
105
py
lightning
lightning-master/src/lightning/pytorch/trainer/trainer.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
72,920
42.457092
120
py
lightning
lightning-master/src/lightning/pytorch/trainer/connectors/signal_connector.py
import logging import os import signal import sys import threading from subprocess import call from types import FrameType from typing import Any, Callable, Dict, List, Set, Union from lightning_utilities.core.rank_zero import rank_prefixed_message import lightning.pytorch as pl from lightning.fabric.plugins.environm...
7,261
40.497143
118
py
lightning
lightning-master/src/lightning/pytorch/trainer/connectors/checkpoint_connector.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
24,363
43.869245
119
py
lightning
lightning-master/src/lightning/pytorch/trainer/connectors/accelerator_connector.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
33,907
46.423776
120
py
lightning
lightning-master/src/lightning/pytorch/trainer/connectors/data_connector.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
23,019
43.873294
118
py
lightning
lightning-master/src/lightning/pytorch/trainer/connectors/callback_connector.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
10,278
43.886463
120
py
lightning
lightning-master/src/lightning/pytorch/trainer/connectors/logger_connector/logger_connector.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
9,984
37.85214
118
py
lightning
lightning-master/src/lightning/pytorch/trainer/connectors/logger_connector/fx_validator.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
9,267
45.572864
119
py
lightning
lightning-master/src/lightning/pytorch/trainer/connectors/logger_connector/__init__.py
from lightning.pytorch.trainer.connectors.logger_connector.logger_connector import _LoggerConnector # noqa: F401
114
56.5
113
py
lightning
lightning-master/src/lightning/pytorch/trainer/connectors/logger_connector/result.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
19,890
37.325626
118
py
lightning
lightning-master/src/lightning/pytorch/strategies/single_xla.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
3,238
36.662791
93
py
lightning
lightning-master/src/lightning/pytorch/strategies/utils.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
1,780
35.346939
110
py
lightning
lightning-master/src/lightning/pytorch/strategies/strategy.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
25,039
40.184211
120
py
lightning
lightning-master/src/lightning/pytorch/strategies/deepspeed.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
42,390
45.077174
120
py
lightning
lightning-master/src/lightning/pytorch/strategies/single_device.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
3,294
33.322917
113
py
lightning
lightning-master/src/lightning/pytorch/strategies/fsdp.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
22,334
43.849398
120
py
lightning
lightning-master/src/lightning/pytorch/strategies/__init__.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
1,582
41.783784
89
py
lightning
lightning-master/src/lightning/pytorch/strategies/parallel.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
4,977
38.507937
115
py
lightning
lightning-master/src/lightning/pytorch/strategies/xla.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
11,801
37.568627
119
py
lightning
lightning-master/src/lightning/pytorch/strategies/ddp.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
18,868
44.358173
119
py
lightning
lightning-master/src/lightning/pytorch/strategies/launchers/subprocess_script.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
6,457
44.160839
120
py
lightning
lightning-master/src/lightning/pytorch/strategies/launchers/launcher.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
931
37.833333
87
py
lightning
lightning-master/src/lightning/pytorch/strategies/launchers/__init__.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
936
39.73913
94
py
lightning
lightning-master/src/lightning/pytorch/strategies/launchers/multiprocessing.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
12,993
43.652921
120
py
lightning
lightning-master/src/lightning/pytorch/strategies/launchers/xla.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
6,973
41.785276
119
py
lightning
lightning-master/src/lightning/pytorch/callbacks/checkpoint.py
from lightning.pytorch.callbacks.callback import Callback class Checkpoint(Callback): r"""This is the base class for model checkpointing. Expert users may want to subclass it in case of writing custom :class:`~lightning.pytorch.callbacksCheckpoint` callback, so that the trainer recognizes the custom clas...
359
35
114
py
lightning
lightning-master/src/lightning/pytorch/callbacks/timer.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
7,595
42.159091
118
py
lightning
lightning-master/src/lightning/pytorch/callbacks/lr_monitor.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
14,157
41.262687
118
py
lightning
lightning-master/src/lightning/pytorch/callbacks/prediction_writer.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
5,596
36.066225
117
py
lightning
lightning-master/src/lightning/pytorch/callbacks/rich_model_summary.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
4,034
35.351351
115
py
lightning
lightning-master/src/lightning/pytorch/callbacks/lambda_function.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
3,432
40.865854
93
py
lightning
lightning-master/src/lightning/pytorch/callbacks/model_summary.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
3,560
38.131868
118
py
lightning
lightning-master/src/lightning/pytorch/callbacks/early_stopping.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
11,777
43.278195
120
py
lightning
lightning-master/src/lightning/pytorch/callbacks/device_stats_monitor.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
5,504
34.746753
120
py
lightning
lightning-master/src/lightning/pytorch/callbacks/batch_size_finder.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
8,116
39.994949
115
py
lightning
lightning-master/src/lightning/pytorch/callbacks/model_checkpoint.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
35,871
47.021419
120
py
lightning
lightning-master/src/lightning/pytorch/callbacks/gradient_accumulation_scheduler.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
6,376
43.284722
111
py
lightning
lightning-master/src/lightning/pytorch/callbacks/pruning.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
22,841
46.5875
142
py
lightning
lightning-master/src/lightning/pytorch/callbacks/spike.py
import os from typing import Any, Mapping, Union import torch import lightning.pytorch as pl from lightning.fabric.utilities.spike import SpikeDetection as FabricSpikeDetection from lightning.pytorch.callbacks.callback import Callback class SpikeDetection(FabricSpikeDetection, Callback): @torch.no_grad() de...
1,127
34.25
116
py
lightning
lightning-master/src/lightning/pytorch/callbacks/__init__.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
2,617
42.633333
101
py
lightning
lightning-master/src/lightning/pytorch/callbacks/callback.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
11,006
38.593525
120
py
lightning
lightning-master/src/lightning/pytorch/callbacks/finetuning.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
18,525
43.004751
116
py
lightning
lightning-master/src/lightning/pytorch/callbacks/lr_finder.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
4,793
37.047619
113
py
lightning
lightning-master/src/lightning/pytorch/callbacks/stochastic_weight_avg.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
17,781
49.373938
119
py
lightning
lightning-master/src/lightning/pytorch/callbacks/on_exception_checkpoint.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
2,201
32.363636
111
py
lightning
lightning-master/src/lightning/pytorch/callbacks/progress/progress_bar.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
8,890
39.230769
120
py
lightning
lightning-master/src/lightning/pytorch/callbacks/progress/tqdm_progress.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
16,070
37.264286
118
py
lightning
lightning-master/src/lightning/pytorch/callbacks/progress/__init__.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
944
38.375
92
py
lightning
lightning-master/src/lightning/pytorch/callbacks/progress/rich_progress.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
24,202
38.612111
119
py
lightning
lightning-master/src/lightning/pytorch/core/hooks.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
25,817
37.4769
120
py
lightning
lightning-master/src/lightning/pytorch/core/module.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
69,300
42.778269
120
py
lightning
lightning-master/src/lightning/pytorch/core/datamodule.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
10,293
43.756522
119
py
lightning
lightning-master/src/lightning/pytorch/core/saving.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
12,807
36.893491
120
py
lightning
lightning-master/src/lightning/pytorch/core/__init__.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
760
39.052632
74
py
lightning
lightning-master/src/lightning/pytorch/core/optimizer.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
17,859
43.874372
119
py
lightning
lightning-master/src/lightning/pytorch/core/mixins/hparams_mixin.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
6,325
39.292994
115
py
lightning
lightning-master/src/lightning/pytorch/core/mixins/__init__.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
672
43.866667
90
py
lightning
lightning-master/src/lightning/pytorch/loops/prediction_loop.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
16,041
45.364162
120
py
lightning
lightning-master/src/lightning/pytorch/loops/fit_loop.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
17,767
42.442543
120
py
lightning
lightning-master/src/lightning/pytorch/loops/evaluation_loop.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
24,112
42.921676
120
py
lightning
lightning-master/src/lightning/pytorch/loops/loop.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
3,469
35.914894
109
py
lightning
lightning-master/src/lightning/pytorch/loops/fetchers.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
7,466
35.783251
120
py
lightning
lightning-master/src/lightning/pytorch/loops/utilities.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
8,581
40.863415
113
py
lightning
lightning-master/src/lightning/pytorch/loops/__init__.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
1,108
54.45
106
py
lightning
lightning-master/src/lightning/pytorch/loops/training_epoch_loop.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
20,487
47.320755
120
py
lightning
lightning-master/src/lightning/pytorch/loops/optimization/manual.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
5,422
40.083333
120
py
lightning
lightning-master/src/lightning/pytorch/loops/optimization/closure.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
2,622
38.149254
119
py
lightning
lightning-master/src/lightning/pytorch/loops/optimization/automatic.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
12,517
39.511327
120
py
lightning
lightning-master/src/lightning/pytorch/loops/optimization/__init__.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
768
44.235294
95
py
lightning
lightning-master/src/lightning/pytorch/_graveyard/tpu.py
# Copyright The Lightning AI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
3,910
36.605769
120
py
lightning
lightning-master/src/lightning/pytorch/_graveyard/ipu.py
import sys from typing import Any import lightning.pytorch as pl def _patch_sys_modules() -> None: self = sys.modules[__name__] sys.modules["lightning.pytorch.accelerators.ipu"] = self sys.modules["lightning.pytorch.strategies.ipu"] = self sys.modules["lightning.pytorch.plugins.precision.ipu"] = self...
2,039
37.490566
96
py
lightning
lightning-master/src/lightning/pytorch/_graveyard/hpu.py
import sys from typing import Any import lightning.pytorch as pl def _patch_sys_modules() -> None: self = sys.modules[__name__] sys.modules["lightning.pytorch.accelerators.hpu"] = self sys.modules["lightning.pytorch.strategies.hpu_parallel"] = self sys.modules["lightning.pytorch.strategies.single_hpu...
3,627
38.868132
93
py