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 |
|---|---|---|---|---|---|
pytorch-lightning | tests/tests_pytorch/callbacks/test_model_checkpoint_additional_cases.py | .py | import math
import os
from datetime import timedelta
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset
from lightning.pytorch import LightningModule, Trainer, seed_everything
from lightning.pytorch.callbacks import ModelCheckpoint
from li... | 232 | 7,527 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_pruning.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... | 554 | 22,057 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_lambda_function.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... | 72 | 2,199 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_lr_monitor.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... | 820 | 29,848 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_callback_hook_outputs.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 | 1,893 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_model_checkpoint_step_interval_val_metric.py | .py | import math
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset
from lightning.pytorch import LightningModule, Trainer, seed_everything
from lightning.pytorch.callbacks import ModelCheckpoint
class TinyDataset(Dataset):
def __init__(s... | 107 | 3,590 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_finetuning_callback.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... | 431 | 16,501 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_prediction_writer.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... | 125 | 5,393 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_callbacks.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... | 168 | 6,067 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_timer.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,435 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_gradient_accumulation_scheduler.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,691 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_model_summary.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... | 77 | 2,885 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_weight_averaging.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... | 452 | 17,370 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_rich_model_summary.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... | 104 | 3,625 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_stochastic_weight_avg.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... | 422 | 16,511 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_device_stats_monitor.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... | 284 | 9,928 |
pytorch-lightning | tests/tests_pytorch/callbacks/test_model_checkpoint_edge_cases.py | .py | import math
from datetime import timedelta
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset
from lightning.pytorch import LightningModule, Trainer, seed_everything
from lightning.pytorch.callbacks import ModelCheckpoint
class TinyDatas... | 175 | 5,914 |
pytorch-lightning | tests/tests_pytorch/callbacks/progress/test_rich_progress_bar.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... | 612 | 20,881 |
pytorch-lightning | tests/tests_pytorch/callbacks/progress/test_tqdm_progress_bar.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... | 859 | 30,887 |
pytorch-lightning | tests/tests_pytorch/utilities/test_imports.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... | 179 | 6,304 |
pytorch-lightning | tests/tests_pytorch/utilities/test_exceptions.py | .py | # Copyright The PyTorch Lightning 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 i... | 45 | 1,703 |
pytorch-lightning | tests/tests_pytorch/utilities/test_dtype_device_mixin.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 | 1,884 |
pytorch-lightning | tests/tests_pytorch/utilities/test_parameter_tying.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... | 75 | 2,547 |
pytorch-lightning | tests/tests_pytorch/utilities/test_combined_loader.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... | 684 | 25,311 |
pytorch-lightning | tests/tests_pytorch/utilities/test_signature_utils.py | .py | import torch
from lightning.pytorch.utilities.signature_utils import is_param_in_hook_signature
def test_param_in_hook_signature():
class LightningModule:
def validation_step(self, dataloader_iter): ...
model = LightningModule()
assert is_param_in_hook_signature(model.validation_step, "dataloade... | 33 | 1,171 |
pytorch-lightning | tests/tests_pytorch/utilities/test_deepspeed_collate_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... | 59 | 2,429 |
pytorch-lightning | tests/tests_pytorch/utilities/test_parsing.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... | 238 | 8,661 |
pytorch-lightning | tests/tests_pytorch/utilities/test_seed.py | .py | import random
from unittest import mock
import numpy as np
import pytest
import torch
from lightning.pytorch.utilities.seed import isolate_rng
from tests_pytorch.helpers.runif import RunIf
@pytest.mark.parametrize("with_torch_cuda", [False, pytest.param(True, marks=RunIf(min_cuda_gpus=1))])
def test_isolate_rng(wit... | 52 | 1,713 |
pytorch-lightning | tests/tests_pytorch/utilities/test_upgrade_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... | 107 | 4,217 |
pytorch-lightning | tests/tests_pytorch/utilities/test_compile.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... | 201 | 7,436 |
pytorch-lightning | tests/tests_pytorch/utilities/test_deepspeed_model_summary.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... | 93 | 3,137 |
pytorch-lightning | tests/tests_pytorch/utilities/test_auto_restart.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... | 134 | 5,575 |
pytorch-lightning | tests/tests_pytorch/utilities/test_grads.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... | 95 | 3,214 |
pytorch-lightning | tests/tests_pytorch/utilities/test_pytree.py | .py | import torch
from torch.utils.data import DataLoader, TensorDataset
from lightning.pytorch.utilities._pytree import _tree_flatten, tree_unflatten
def assert_tree_flatten_unflatten(pytree, leaves):
flat, spec = _tree_flatten(pytree)
assert flat == leaves
unflattened = tree_unflatten(flat, spec)
assert... | 67 | 2,497 |
pytorch-lightning | tests/tests_pytorch/utilities/test_consolidate_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... | 34 | 1,323 |
pytorch-lightning | tests/tests_pytorch/utilities/test_model_summary.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... | 509 | 18,307 |
pytorch-lightning | tests/tests_pytorch/utilities/test_warnings.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... | 73 | 2,525 |
pytorch-lightning | tests/tests_pytorch/utilities/test_data.py | .py | from dataclasses import dataclass
from unittest.mock import Mock
import numpy as np
import pytest
import torch
from lightning_utilities.test.warning import no_warning_call
from torch import Tensor
from torch.utils.data import BatchSampler, DataLoader, RandomSampler, SequentialSampler
from lightning.fabric.utilities.d... | 363 | 15,038 |
pytorch-lightning | tests/tests_pytorch/utilities/test_types.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... | 38 | 1,143 |
pytorch-lightning | tests/tests_pytorch/utilities/test_memory.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... | 32 | 1,178 |
pytorch-lightning | tests/tests_pytorch/utilities/test_all_gather_grad.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... | 134 | 5,029 |
pytorch-lightning | tests/tests_pytorch/utilities/test_model_helpers.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... | 197 | 6,543 |
pytorch-lightning | tests/tests_pytorch/utilities/testing/test_runif.py | .py | import pytest
from tests_pytorch.helpers.runif import RunIf
@RunIf(min_torch="99")
def test_always_skip():
exit(1)
@pytest.mark.parametrize("arg1", [0.5, 1.0, 2.0])
@RunIf(min_torch="0.0")
def test_wrapper(arg1: float):
assert arg1 > 0.0
| 15 | 251 |
pytorch-lightning | tests/tests_pytorch/utilities/migration/test_migration.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... | 279 | 13,146 |
pytorch-lightning | tests/tests_pytorch/utilities/migration/test_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... | 231 | 10,356 |
pytorch-lightning | tests/tests_pytorch/graveyard/test_precision.py | .py | import pytest
def test_precision_plugin_renamed_imports():
# base class
from lightning.pytorch.plugins.precision.precision_plugin import PrecisionPlugin as PrecisionPlugin0
from lightning.pytorch.plugins import PrecisionPlugin as PrecisionPlugin2
from lightning.pytorch.plugins.precision import Precis... | 115 | 5,806 |
pytorch-lightning | tests/tests_pytorch/graveyard/test_hpu.py | .py | from importlib import import_module
import pytest
@pytest.mark.parametrize(
("import_path", "name"),
[
("lightning.pytorch.accelerators", "HPUAccelerator"),
("lightning.pytorch.accelerators.hpu", "HPUAccelerator"),
("lightning.pytorch.strategies", "HPUParallelStrategy"),
("lig... | 28 | 1,078 |
pytorch-lightning | tests/tests_pytorch/graveyard/test_tpu.py | .py | from importlib import import_module
import pytest
import torch
@pytest.mark.parametrize(
("import_path", "name"),
[
("lightning.pytorch.strategies", "SingleTPUStrategy"),
("lightning.pytorch.strategies.single_tpu", "SingleTPUStrategy"),
],
)
def test_graveyard_single_tpu(import_path, name... | 42 | 1,594 |
pytorch-lightning | tests/tests_pytorch/loops/test_training_epoch_loop.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... | 231 | 8,765 |
pytorch-lightning | tests/tests_pytorch/loops/test_prediction_loop.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... | 310 | 11,138 |
pytorch-lightning | tests/tests_pytorch/loops/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... | 110 | 4,009 |
pytorch-lightning | tests/tests_pytorch/loops/test_training_loop.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... | 348 | 12,400 |
pytorch-lightning | tests/tests_pytorch/loops/test_fetchers.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... | 709 | 27,984 |
pytorch-lightning | tests/tests_pytorch/loops/test_training_loop_flow_dict.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 | 4,677 |
pytorch-lightning | tests/tests_pytorch/loops/test_loop_state_dict.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... | 102 | 4,300 |
pytorch-lightning | tests/tests_pytorch/loops/test_progress.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... | 110 | 3,713 |
pytorch-lightning | tests/tests_pytorch/loops/test_double_iter_in_iterable_dataset.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... | 77 | 2,641 |
pytorch-lightning | tests/tests_pytorch/loops/test_flow_warnings.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... | 43 | 1,319 |
pytorch-lightning | tests/tests_pytorch/loops/test_loops.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,297 | 48,740 |
pytorch-lightning | tests/tests_pytorch/loops/test_evaluation_loop.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... | 492 | 18,514 |
pytorch-lightning | tests/tests_pytorch/loops/test_evaluation_loop_flow.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... | 111 | 3,687 |
pytorch-lightning | tests/tests_pytorch/loops/test_training_loop_flow_scalar.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 | 7,927 |
pytorch-lightning | tests/tests_pytorch/loops/optimization/test_automatic_loop.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... | 111 | 3,448 |
pytorch-lightning | tests/tests_pytorch/loops/optimization/test_closure.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,668 |
pytorch-lightning | tests/tests_pytorch/loops/optimization/test_manual_loop.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... | 46 | 1,702 |
pytorch-lightning | tests/tests_pytorch/models/test_ddp_fork_amp.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... | 31 | 1,219 |
pytorch-lightning | tests/tests_pytorch/models/test_hparams.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,065 | 37,953 |
pytorch-lightning | tests/tests_pytorch/models/test_amp.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... | 165 | 5,280 |
pytorch-lightning | tests/tests_pytorch/models/test_cpu.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... | 323 | 9,497 |
pytorch-lightning | tests/tests_pytorch/models/test_fabric_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... | 86 | 3,003 |
pytorch-lightning | tests/tests_pytorch/models/test_tpu.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... | 336 | 11,213 |
pytorch-lightning | tests/tests_pytorch/models/test_torchscript.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... | 258 | 9,883 |
pytorch-lightning | tests/tests_pytorch/models/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... | 232 | 8,642 |
pytorch-lightning | tests/tests_pytorch/models/test_onnx.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... | 217 | 7,322 |
pytorch-lightning | tests/tests_pytorch/models/test_restore.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... | 674 | 24,015 |
pytorch-lightning | tests/tests_pytorch/models/test_torch_tensorrt.py | .py | import os
import re
from io import BytesIO
from pathlib import Path
import pytest
import torch
import tests_pytorch.helpers.pipelines as pipes
from lightning.pytorch.core.module import _TORCH_TRT_AVAILABLE
from lightning.pytorch.demos.boring_classes import BoringModel
from lightning.pytorch.utilities.exceptions impor... | 163 | 5,035 |
pytorch-lightning | tests/tests_pytorch/models/test_hooks.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... | 989 | 39,851 |
pytorch-lightning | tests/tests_pytorch/tuner/test_scale_batch_size.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... | 637 | 25,700 |
pytorch-lightning | tests/tests_pytorch/tuner/test_tuning.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 | 2,011 |
pytorch-lightning | tests/tests_pytorch/tuner/test_lr_finder.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... | 904 | 32,126 |
pytorch-lightning | tests/tests_pytorch/plugins/test_async_checkpoint.py | .py | import time
from typing import Any, Optional
import pytest
import torch
from lightning.fabric.plugins.io.checkpoint_io import CheckpointIO
from lightning.pytorch.plugins.io.async_plugin import AsyncCheckpointIO
class _CaptureCheckpointIO(CheckpointIO):
def __init__(self) -> None:
self.saved: Optional[di... | 54 | 1,884 |
pytorch-lightning | tests/tests_pytorch/plugins/test_amp_plugins.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... | 221 | 7,342 |
pytorch-lightning | tests/tests_pytorch/plugins/test_checkpoint_io_plugin.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,522 |
pytorch-lightning | tests/tests_pytorch/plugins/test_cluster_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... | 113 | 4,851 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/test_all.py | .py | import pytest
import torch
from lightning.pytorch.plugins import (
DeepSpeedPrecision,
DoublePrecision,
FSDPPrecision,
HalfPrecision,
)
@pytest.mark.parametrize(
"precision",
[
DeepSpeedPrecision("16-true"),
DoublePrecision(),
HalfPrecision(),
"fsdp",
],
)
... | 36 | 949 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/test_bitsandbytes.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,257 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/test_amp.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... | 199 | 7,725 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/test_amp_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... | 88 | 3,084 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/test_double.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... | 194 | 6,802 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/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... | 77 | 2,695 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/test_deepspeed_precision.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... | 76 | 2,503 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/test_half.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... | 100 | 3,073 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/test_transformer_engine.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... | 76 | 3,284 |
pytorch-lightning | tests/tests_pytorch/plugins/precision/test_fsdp.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... | 187 | 7,189 |
pytorch-lightning | tests/tests_pytorch/helpers/runif.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,331 |
pytorch-lightning | tests/tests_pytorch/helpers/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... | 60 | 2,083 |
pytorch-lightning | tests/tests_pytorch/helpers/datasets.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 | 7,546 |
pytorch-lightning | tests/tests_pytorch/helpers/__init__.py | .py | from lightning.pytorch.demos.boring_classes import ( # noqa: F401
BoringDataModule,
BoringModel,
ManualOptimBoringModel,
RandomDataset,
)
from tests_pytorch.helpers.datasets import TrialMNIST # noqa: F401
| 8 | 223 |
pytorch-lightning | tests/tests_pytorch/helpers/test_datasets.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... | 49 | 1,625 |
pytorch-lightning | tests/tests_pytorch/helpers/test_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... | 60 | 2,198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.