← Về thư mục
tests/pytorch-lightning/test_scripts.py
- build_or_skip · function · L68-L87 — def build_or_skip(test: unittest.TestCase, builder, args, *kwargs)
- ModuleArchitectureTests · class · L90-L133 — class ModuleArchitectureTests(unittest.TestCase)
- test_the_hyperparameters_are_saved_and_reachable · method · L91-L100 — def test_the_hyperparameters_are_saved_and_reachable(self) -> None: # save_hyperparameters() is what makes checkpoints reloadable without # repeating the constructor arguments.
- test_the_network_maps_784_inputs_to_10_logits · method · L102-L105 — def test_the_network_maps_784_inputs_to_10_logits(self) -> None
- test_the_parameter_count_is_the_two_dense_layers · method · L107-L117 — def test_the_parameter_count_is_the_two_dense_layers(self) -> None: # 784h + h + h10 + 10, which the demo block now prints correctly.
- test_dropout_is_active_in_training_and_disabled_in_eval · method · L119-L133 — def test_dropout_is_active_in_training_and_disabled_in_eval(self) -> None: # A template that leaves dropout on at inference reports noisy metrics.
- OptimiserConfigurationTests · class · L136-L178 — class OptimiserConfigurationTests(unittest.TestCase)
- setUp · method · L137-L143 — def setUp(self) -> None
- test_it_returns_an_adam_optimiser_at_the_requested_learning_rate · method · L145-L149 — def test_it_returns_an_adam_optimiser_at_the_requested_learning_rate(self) -> None
- test_the_optimiser_owns_every_model_parameter · method · L151-L156 — def test_the_optimiser_owns_every_model_parameter(self) -> None
- test_the_scheduler_halves_the_rate_on_a_five_epoch_plateau · method · L158-L163 — def test_the_scheduler_halves_the_rate_on_a_five_epoch_plateau(self) -> None
- test_the_scheduler_watches_a_metric_the_module_logs · method · L165-L170 — def test_the_scheduler_watches_a_metric_the_module_logs(self) -> None: # Lightning raises at the end of the first epoch if the monitored key # was never logged, so these two have to agree.
- test_the_plateau_scheduler_actually_reduces_the_rate · method · L172-L178 — def test_the_plateau_scheduler_actually_reduces_the_rate(self) -> None: # patience=5 means six non-improving epochs before the drop.
- DataModuleTests · class · L181-L277 — class DataModuleTests(unittest.TestCase)
- setUpClass · method · L185-L190 — def setUpClass(cls) -> None
- test_the_split_honours_the_requested_ratio · method · L192-L197 — def test_the_split_honours_the_requested_ratio(self) -> None
- test_the_split_is_seeded_so_two_runs_agree · method · L199-L211 — def test_the_split_is_seeded_so_two_runs_agree(self) -> None: # random_split is given an explicit generator seed; without it the # validation set would change every run and every resumed checkpoint.
- test_the_training_loader_shuffles_and_drops_the_short_batch · method · L213-L218 — def test_the_training_loader_shuffles_and_drops_the_short_batch(self) -> None
- test_the_validation_loader_keeps_order_and_every_sample · method · L220-L225 — def test_the_validation_loader_keeps_order_and_every_sample(self) -> None
- test_a_batch_has_the_declared_shape_and_dtypes · method · L227-L233 — def test_a_batch_has_the_declared_shape_and_dtypes(self) -> None
- test_a_different_ratio_moves_the_boundary · method · L235-L241 — def test_a_different_ratio_moves_the_boundary(self) -> None
- test_the_test_and_predict_stages_build_their_own_datasets · method · L243-L252 — def test_the_test_and_predict_stages_build_their_own_datasets(self) -> None
- test_the_checkpointed_state_round_trips · method · L254-L259 — def test_the_checkpointed_state_round_trips(self) -> None
- test_teardown_releases_only_the_stage_it_was_given · method · L261-L267 — def test_teardown_releases_only_the_stage_it_was_given(self) -> None
- test_a_transform_is_applied_to_every_sample · method · L269-L277 — def test_a_transform_is_applied_to_every_sample(self) -> None
- TrainerConfigurationTests · class · L280-L362 — class TrainerConfigurationTests(unittest.TestCase)
- test_the_basic_trainer_runs_ten_epochs_on_whatever_is_available · method · L281-L284 — def test_the_basic_trainer_runs_ten_epochs_on_whatever_is_available(self) -> None
- test_the_debug_trainer_pins_itself_to_the_cpu · method · L286-L294 — def test_the_debug_trainer_pins_itself_to_the_cpu(self) -> None: # Debugging on an accelerator hides the errors you are debugging, and # fast_dev_run is what makes it a debug configuration at all.
- test_the_tuning_trainer_writes_nothing_and_halves_the_data · method · L296-L302 — def test_the_tuning_trainer_writes_nothing_and_halves_the_data(self) -> None
- test_the_overfit_trainer_restricts_itself_to_the_requested_batches · method · L304-L307 — def test_the_overfit_trainer_restricts_itself_to_the_requested_batches(self) -> None
- test_the_production_trainer_checkpoints_stops_early_and_tracks_the_rate · method · L309-L319 — def test_the_production_trainer_checkpoints_stops_early_and_tracks_the_rate(self) -> None
- test_the_time_limited_trainer_is_a_valid_checkpoint_configuration · method · L321-L330 — def test_the_time_limited_trainer_is_a_valid_checkpoint_configuration(self) -> None: # The regression: save_top_k=3 with monitor=None made this function # raise on every machine, GPU or not.
- test_the_reproducible_trainer_seeds_and_pins_full_precision · method · L332-L338 — def test_the_reproducible_trainer_seeds_and_pins_full_precision(self) -> None
- test_the_ddp_trainer_shards_across_the_requested_gpus · method · L341-L346 — def test_the_ddp_trainer_shards_across_the_requested_gpus(self) -> None
- test_the_fsdp_trainer_uses_bfloat16_and_accumulates · method · L349-L355 — def test_the_fsdp_trainer_uses_bfloat16_and_accumulates(self) -> None
- test_the_deepspeed_trainer_selects_the_requested_stage · method · L357-L362 — def test_the_deepspeed_trainer_selects_the_requested_stage(self) -> None
- TrainingLoopTests · class · L365-L439 — class TrainingLoopTests(unittest.TestCase)
- setUpClass · method · L369-L391 — def setUpClass(cls) -> None
- tearDownClass · method · L394-L395 — def tearDownClass(cls) -> None
- test_the_fit_logs_the_metrics_the_template_documents · method · L397-L402 — def test_the_fit_logs_the_metrics_the_template_documents(self) -> None
- test_the_logged_learning_rate_is_the_configured_one · method · L404-L407 — def test_the_logged_learning_rate_is_the_configured_one(self) -> None
- test_the_losses_are_finite_and_the_accuracies_are_proportions · method · L409-L415 — def test_the_losses_are_finite_and_the_accuracies_are_proportions(self) -> None
- test_a_test_pass_reports_its_own_metrics · method · L417-L419 — def test_a_test_pass_reports_its_own_metrics(self) -> None
- test_prediction_returns_one_class_index_per_sample · method · L421-L426 — def test_prediction_returns_one_class_index_per_sample(self) -> None
- test_training_moved_the_weights · method · L428-L439 — def test_training_moved_the_weights(self) -> None: # A fit that leaves every parameter untouched has not trained.