#1616 Accept prec_init as array or list

Open antonis19
Coverage Reach
classification/training/trainer.py classification/training/loggers/checkpointer.py classification/training/loggers/log_manager.py classification/training/loggers/log_writer.py classification/training/loggers/tensorboard_writer.py classification/training/loggers/__init__.py classification/training/schedulers/shuffled_scheduler.py classification/training/schedulers/scheduler.py classification/training/schedulers/sequential_scheduler.py classification/training/schedulers/__init__.py classification/multitask_classifier.py classification/data.py classification/utils.py classification/task.py classification/loss.py classification/__init__.py labeling/model/label_model.py labeling/model/logger.py labeling/model/base_labeler.py labeling/model/baselines.py labeling/model/graph_utils.py labeling/model/__init__.py labeling/apply/core.py labeling/apply/pandas.py labeling/apply/dask.py labeling/lf/nlp.py labeling/lf/core.py labeling/lf/__init__.py labeling/analysis.py labeling/utils.py labeling/__init__.py slicing/utils.py slicing/sliceaware_classifier.py slicing/modules/slice_combiner.py slicing/sf/core.py slicing/sf/nlp.py slicing/sf/__init__.py slicing/monitor.py slicing/__init__.py slicing/apply/core.py augmentation/apply/core.py augmentation/apply/pandas.py augmentation/policy/core.py augmentation/policy/sampling.py augmentation/tf.py augmentation/__init__.py analysis/scorer.py analysis/metrics.py analysis/error_analysis.py analysis/__init__.py map/core.py map/__init__.py utils/core.py utils/optimizers.py utils/lr_schedulers.py utils/config_utils.py utils/data_operators.py utils/__init__.py preprocess/nlp.py preprocess/core.py preprocess/__init__.py synthetic/synthetic_data.py types/data.py types/__init__.py types/hashing.py types/classifier.py version.py __init__.py

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 2 files from the diff.

@@ -280,6 +280,10 @@
Loading
280 280
        # Handle single values
281 281
        if isinstance(self.train_config.prec_init, (int, float)):
282 282
            self._prec_init = self.train_config.prec_init * torch.ones(self.m)
283 +
        if isinstance(self.train_config.prec_init, np.ndarray):
284 +
            self._prec_init = torch.from_numpy(self.train_config.prec_init)
285 +
        if isinstance(self.train_config.prec_init, list):
286 +
            self._prec_init = torch.from_numpy(np.array(self.train_config.prec_init))
283 287
        if self._prec_init.shape[0] != self.m:
284 288
            raise ValueError(f"prec_init must have shape {self.m}.")
285 289

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
snorkel 0.14% 97.35%
Project Totals (68 files) 97.35%
Loading