repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
jumpserver
utils/generate_fake_data/resources/perms.py
.py
from random import choice, sample import forgery_py from .base import FakeDataGenerator from users.models import * from assets.models import * from perms.models import * class AssetPermissionGenerator(FakeDataGenerator): resource = 'asset_permission' user_ids: list user_group_ids: list asset_ids: li...
75
2,637
jumpserver
utils/generate_fake_data/resources/base.py
.py
#!/usr/bin/python import time from itertools import islice from random import seed from orgs.models import Organization class FakeDataGenerator: resource = 'Fake' def __init__(self, batch_size=100, org_id=None): self.batch_size = batch_size self.org = self.switch_org(org_id) seed() ...
50
1,271
pytorch-lightning
setup.py
.py
#!/usr/bin/env python # 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 l...
173
7,877
pytorch-lightning
requirements/collect_env_details.py
.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...
85
2,703
pytorch-lightning
docs/source-pytorch/conf.py
.py
# # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------- # If extensions (or ...
639
26,719
pytorch-lightning
docs/source-fabric/conf.py
.py
# Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------- # If extensions (or mo...
396
14,152
pytorch-lightning
tests/parity_fabric/utils.py
.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...
59
2,194
pytorch-lightning
tests/parity_fabric/models.py
.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...
82
2,515
pytorch-lightning
tests/parity_fabric/test_parity_simple.py
.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...
154
4,749
pytorch-lightning
tests/parity_fabric/test_parity_ddp.py
.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...
167
5,352
pytorch-lightning
tests/parity_fabric/conftest.py
.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
1,087
pytorch-lightning
tests/tests_pytorch/test_cli.py
.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,979
77,973
pytorch-lightning
tests/tests_pytorch/conftest.py
.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...
394
15,164
pytorch-lightning
tests/tests_pytorch/loggers/test_utilities.py
.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...
34
1,251
pytorch-lightning
tests/tests_pytorch/loggers/test_mlflow.py
.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...
430
17,273
pytorch-lightning
tests/tests_pytorch/loggers/test_wandb.py
.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...
679
25,414
pytorch-lightning
tests/tests_pytorch/loggers/test_all.py
.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...
342
11,930
pytorch-lightning
tests/tests_pytorch/loggers/test_tensorboard.py
.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...
326
11,712
pytorch-lightning
tests/tests_pytorch/loggers/test_csv.py
.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...
204
7,397
pytorch-lightning
tests/tests_pytorch/loggers/test_comet.py
.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...
202
6,586
pytorch-lightning
tests/tests_pytorch/loggers/test_logger.py
.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...
351
11,761
pytorch-lightning
tests/tests_pytorch/loggers/test_litlogger.py
.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...
369
13,534
pytorch-lightning
tests/tests_pytorch/loggers/conftest.py
.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...
151
5,306
pytorch-lightning
tests/tests_pytorch/serve/test_servable_module_validator.py
.py
import pytest import torch from torch import Tensor from lightning.pytorch import Trainer from lightning.pytorch.demos.boring_classes import BoringModel from lightning.pytorch.serve.servable_module_validator import ServableModule, ServableModuleValidator from tests_pytorch.helpers.runif import _xfail_gloo_windows cl...
53
1,571
pytorch-lightning
tests/tests_pytorch/demos/transformer.py
.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...
27
1,056
pytorch-lightning
tests/tests_pytorch/demos/lstm.py
.py
from lightning.pytorch.demos.lstm import SequenceSampler def test_sequence_sampler(): dataset = list(range(103)) sampler = SequenceSampler(dataset, batch_size=4) assert len(sampler) == 25 batches = list(sampler) assert batches[0] == [0, 25, 50, 75] assert batches[1] == [1, 26, 51, 76] asse...
12
355
pytorch-lightning
tests/tests_pytorch/trainer/test_dataloaders.py
.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,433
55,678
pytorch-lightning
tests/tests_pytorch/trainer/test_trainer.py
.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,161
79,386
pytorch-lightning
tests/tests_pytorch/trainer/test_config_validator.py
.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...
163
6,171
pytorch-lightning
tests/tests_pytorch/trainer/test_states.py
.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...
91
3,513
pytorch-lightning
tests/tests_pytorch/trainer/test_ddp_sigterm_handling.py
.py
import os import signal import time import pytest import torch import torch.multiprocessing as mp from lightning.pytorch import LightningModule, Trainer, seed_everything from lightning.pytorch.demos.boring_classes import BoringDataModule from lightning.pytorch.strategies.ddp import DDPStrategy from lightning.pytorch....
81
2,531
pytorch-lightning
tests/tests_pytorch/trainer/properties/test_loggers.py
.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...
97
2,873
pytorch-lightning
tests/tests_pytorch/trainer/properties/test_get_model.py
.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...
80
2,373
pytorch-lightning
tests/tests_pytorch/trainer/properties/test_log_dir.py
.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...
135
4,635
pytorch-lightning
tests/tests_pytorch/trainer/properties/test_estimated_stepping_batches.py
.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...
158
6,174
pytorch-lightning
tests/tests_pytorch/trainer/dynamic_args/test_multiple_eval_dataloaders.py
.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...
74
2,222
pytorch-lightning
tests/tests_pytorch/trainer/connectors/test_checkpoint_connector.py
.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...
317
12,664
pytorch-lightning
tests/tests_pytorch/trainer/connectors/test_data_connector.py
.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...
698
27,215
pytorch-lightning
tests/tests_pytorch/trainer/connectors/test_callback_connector.py
.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...
403
14,388
pytorch-lightning
tests/tests_pytorch/trainer/connectors/test_logger_connector.py
.py
from unittest.mock import MagicMock, patch from lightning.pytorch import Trainer from lightning.pytorch.loggers import Logger from lightning.pytorch.trainer.connectors.logger_connector import _LoggerConnector @patch("lightning.pytorch.trainer.connectors.logger_connector.logger_connector.convert_tensors_to_scalars") ...
62
2,695
pytorch-lightning
tests/tests_pytorch/trainer/connectors/test_signal_connector.py
.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...
192
7,093
pytorch-lightning
tests/tests_pytorch/trainer/connectors/test_rich_integration.py
.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...
157
8,334
pytorch-lightning
tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py
.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...
995
39,511
pytorch-lightning
tests/tests_pytorch/trainer/optimization/test_optimizers.py
.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...
660
25,905
pytorch-lightning
tests/tests_pytorch/trainer/optimization/test_backward_calls.py
.py
from unittest.mock import patch import pytest import torch from lightning.pytorch import Trainer from lightning.pytorch.demos.boring_classes import BoringModel @pytest.mark.parametrize("num_steps", [1, 2, 3]) @patch("torch.Tensor.backward") def test_backward_count_simple(torch_backward, num_steps): """Test that...
60
1,973
pytorch-lightning
tests/tests_pytorch/trainer/optimization/test_manual_optimization.py
.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...
947
33,905
pytorch-lightning
tests/tests_pytorch/trainer/optimization/test_multiple_optimizers.py
.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...
89
3,004
pytorch-lightning
tests/tests_pytorch/trainer/flags/test_inference_mode.py
.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...
86
2,752
pytorch-lightning
tests/tests_pytorch/trainer/flags/test_fast_dev_run.py
.py
import os from unittest.mock import Mock import pytest import torch from lightning.pytorch import Trainer from lightning.pytorch.callbacks import EarlyStopping, ModelCheckpoint from lightning.pytorch.demos.boring_classes import BoringModel from lightning.pytorch.loggers import TensorBoardLogger from lightning.pytorch...
127
5,077
pytorch-lightning
tests/tests_pytorch/trainer/flags/test_barebones.py
.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...
71
3,061
pytorch-lightning
tests/tests_pytorch/trainer/flags/test_env_vars.py
.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...
58
2,101
pytorch-lightning
tests/tests_pytorch/trainer/flags/test_overfit_batches.py
.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...
214
7,961
pytorch-lightning
tests/tests_pytorch/trainer/flags/test_val_check_interval.py
.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...
249
8,794
pytorch-lightning
tests/tests_pytorch/trainer/flags/test_check_val_every_n_epoch.py
.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...
82
2,827
pytorch-lightning
tests/tests_pytorch/trainer/flags/test_min_max_epochs.py
.py
import pytest from lightning_utilities.test.warning import no_warning_call from lightning.fabric.utilities.warnings import PossibleUserWarning from lightning.pytorch import Trainer from lightning.pytorch.demos.boring_classes import BoringModel @pytest.mark.parametrize( ("min_epochs", "max_epochs", "min_steps", "...
60
1,910
pytorch-lightning
tests/tests_pytorch/trainer/flags/test_limit_batches.py
.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...
105
3,836
pytorch-lightning
tests/tests_pytorch/trainer/logging_/test_train_loop_logging.py
.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...
780
29,441
pytorch-lightning
tests/tests_pytorch/trainer/logging_/test_loop_logging.py
.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...
105
4,026
pytorch-lightning
tests/tests_pytorch/trainer/logging_/test_logger_connector.py
.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...
663
25,161
pytorch-lightning
tests/tests_pytorch/trainer/logging_/test_eval_loop_logging.py
.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...
991
47,914
pytorch-lightning
tests/tests_pytorch/trainer/logging_/test_distributed_logging.py
.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...
198
6,056
pytorch-lightning
tests/tests_pytorch/overrides/test_distributed.py
.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...
99
3,650
pytorch-lightning
tests/tests_pytorch/strategies/test_custom_strategy.py
.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...
50
1,965
pytorch-lightning
tests/tests_pytorch/strategies/test_ddp.py
.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...
220
8,660
pytorch-lightning
tests/tests_pytorch/strategies/test_registry.py
.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...
154
5,653
pytorch-lightning
tests/tests_pytorch/strategies/test_model_parallel_integration.py
.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...
613
22,580
pytorch-lightning
tests/tests_pytorch/strategies/test_ddp_integration.py
.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...
498
17,799
pytorch-lightning
tests/tests_pytorch/strategies/test_single_device.py
.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...
135
4,681
pytorch-lightning
tests/tests_pytorch/strategies/test_ddp_integration_comm_hook.py
.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...
244
8,414
pytorch-lightning
tests/tests_pytorch/strategies/test_xla.py
.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...
65
2,605
pytorch-lightning
tests/tests_pytorch/strategies/test_model_parallel.py
.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...
345
12,932
pytorch-lightning
tests/tests_pytorch/strategies/test_deepspeed.py
.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,325
50,598
pytorch-lightning
tests/tests_pytorch/strategies/test_common.py
.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...
90
3,349
pytorch-lightning
tests/tests_pytorch/strategies/test_fsdp.py
.py
import os from contextlib import nullcontext from copy import deepcopy from datetime import timedelta from functools import partial from pathlib import Path from re import escape from typing import Optional from unittest import mock from unittest.mock import ANY, MagicMock, Mock import pytest import torch import torch...
1,100
44,941
pytorch-lightning
tests/tests_pytorch/strategies/launchers/test_multiprocessing.py
.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...
240
10,139
pytorch-lightning
tests/tests_pytorch/strategies/launchers/test_subprocess_script.py
.py
import subprocess import sys from unittest import mock from unittest.mock import Mock import pytest from lightning_utilities.core.imports import RequirementCache from lightning.pytorch.strategies.launchers.subprocess_script import _SubprocessScriptLauncher from tests_pytorch.helpers.runif import RunIf _HYDRA_WITH_RU...
104
3,652
pytorch-lightning
tests/tests_pytorch/strategies/scripts/cli_script.py
.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...
26
987
pytorch-lightning
tests/tests_pytorch/checkpointing/test_model_checkpoint.py
.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,183
82,856
pytorch-lightning
tests/tests_pytorch/checkpointing/test_trainer_checkpoint.py
.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...
123
5,275
pytorch-lightning
tests/tests_pytorch/checkpointing/test_legacy_checkpoints.py
.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...
138
5,506
pytorch-lightning
tests/tests_pytorch/checkpointing/test_torch_saving.py
.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...
71
2,272
pytorch-lightning
tests/tests_pytorch/checkpointing/test_checkpoint_callback_frequency.py
.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...
149
5,388
pytorch-lightning
tests/tests_pytorch/accelerators/test_cpu.py
.py
import os from pathlib import Path from typing import Any, Union from unittest.mock import Mock import pytest import torch import lightning.pytorch as pl from lightning.fabric.plugins import TorchCheckpointIO from lightning.pytorch import Trainer from lightning.pytorch.accelerators import CPUAccelerator from lightnin...
80
2,807
pytorch-lightning
tests/tests_pytorch/accelerators/test_mps.py
.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...
143
5,109
pytorch-lightning
tests/tests_pytorch/accelerators/test_gpu.py
.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...
71
2,324
pytorch-lightning
tests/tests_pytorch/accelerators/test_xla.py
.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...
327
11,988
pytorch-lightning
tests/tests_pytorch/accelerators/test_common.py
.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...
63
2,021
pytorch-lightning
tests/tests_pytorch/deprecated_api/test_no_removal_version.py
.py
import sys from unittest.mock import Mock import pytest import torch.nn import lightning.fabric from lightning.pytorch import Trainer from lightning.pytorch.demos.boring_classes import BoringModel from lightning.pytorch.plugins.precision.double import LightningDoublePrecisionModule from lightning.pytorch.strategies i...
128
4,782
pytorch-lightning
tests/tests_pytorch/profilers/test_xla_profiler.py
.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...
60
2,048
pytorch-lightning
tests/tests_pytorch/profilers/test_profiler.py
.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...
740
28,517
pytorch-lightning
tests/tests_pytorch/core/test_lightning_module.py
.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...
618
22,947
pytorch-lightning
tests/tests_pytorch/core/test_saving.py
.py
from unittest.mock import ANY, Mock import pytest import torch import lightning.pytorch as pl from lightning.pytorch.callbacks import ModelCheckpoint from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel from tests_pytorch.conftest import mock_cuda_count, mock_mps_count from tests_pytorch.h...
192
8,043
pytorch-lightning
tests/tests_pytorch/core/test_metric_result_integration.py
.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...
634
23,143
pytorch-lightning
tests/tests_pytorch/core/test_results.py
.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...
57
2,351
pytorch-lightning
tests/tests_pytorch/core/test_lightning_optimizer.py
.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...
343
12,560
pytorch-lightning
tests/tests_pytorch/core/test_datamodules.py
.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...
623
21,352
pytorch-lightning
tests/tests_pytorch/callbacks/test_model_checkpoint_manual_opt.py
.py
import shutil import tempfile import warnings from contextlib import contextmanager from copy import deepcopy from pathlib import Path import torch from torch.utils.data import DataLoader, Dataset from lightning.pytorch import LightningModule, Trainer from lightning.pytorch.callbacks import ModelCheckpoint class Fa...
183
6,575
pytorch-lightning
tests/tests_pytorch/callbacks/test_early_stopping.py
.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...
697
25,650
pytorch-lightning
tests/tests_pytorch/callbacks/test_throughput_monitor.py
.py
import warnings from unittest import mock from unittest.mock import ANY, Mock, call import pytest import torch from lightning.fabric.utilities.throughput import measure_flops from lightning.pytorch import Trainer from lightning.pytorch.callbacks.throughput_monitor import ThroughputMonitor from lightning.pytorch.demos...
514
17,703
pytorch-lightning
tests/tests_pytorch/callbacks/test_spike.py
.py
import contextlib import pytest import torch from lightning.fabric.utilities.imports import _TORCHMETRICS_GREATER_EQUAL_1_0_0 from lightning.fabric.utilities.spike import TrainingSpikeException from lightning.pytorch import LightningModule, Trainer from lightning.pytorch.callbacks.spike import SpikeDetection from tes...
103
4,817