HHousen / lecture2notes

Protected member accessed from outside the class PYL-W0212
Bug risk
Minor
9 months ago4 years old
Access to a protected member _context_initialized of a client class
246    else:
247        if not self.context.is_initialized and not self._context_initialized:
248            self.context.init_state()            
249            self._context_initialized = True250
251    self.context.full_parallel(self.params, data, num_proc)
252    return [
Access to a protected member _context_initialized of a client class
244            self.context.is_initialized
245        ), "strict=True and context is not initialized. Make sure to call 'context.init_state()' before."
246    else:
247        if not self.context.is_initialized and not self._context_initialized:248            self.context.init_state()            
249            self._context_initialized = True
250
Access to a protected member _fc of a client class
580    elif args.arch.startswith("efficientnet"):
581        set_parameter_requires_grad(model_ft, feature_extract)
582        num_ftrs = model_ft._fc.in_features  # pylint: disable=protected-access
583        model_ft._fc = nn.Linear(584            num_ftrs, num_classes
585        )  # pylint: disable=protected-access
586
Access to a protected member _fc of a client class
171                )
172
173            else:
174                model_ft._fc = nn.Linear(175                    num_ftrs, num_classes
176                )  # pylint: disable=protected-access
177
Access to a protected member _fc of a client class
161
162            if self.hparams.feature_extract == "advanced":
163                model_ft._avg_pooling = AdaptiveConcatPool2d(1)  # noqa: F405
164                model_ft._fc = nn.Sequential(165                    nn.Flatten(),
166                    nn.Linear(num_ftrs * 2, 512),
167                    MemoryEfficientSwish(),