6ee3f1b0d2a6ebadc9e2f664354594342ab0805d,kornia/augmentation/augmentation.py,RandomSolarize,__init__,#RandomSolarize#Any#Any#Any#Any#Any#,944
Before Change
super(RandomSolarize, self).__init__(p=p, return_transform=return_transform, same_on_batch=same_on_batch)
thresholds = \
cast(torch.Tensor, thresholds) if isinstance(thresholds, torch.Tensor) else torch.tensor(thresholds)
self.thresholds = _range_bound(thresholds, "thresholds", center=0.5, bounds=(0., 1.))
additions = \
cast(torch.Tensor, additions) if isinstance(additions, torch.Tensor) else torch.tensor(additions)
self.additions = _range_bound(additions, "additions", bounds=(-0.5, 0.5))
After Change
sharpness = cast(torch.Tensor, sharpness) if isinstance(sharpness, torch.Tensor) else torch.tensor(sharpness)
if sharpness.dim() == 0:
self.sharpness = torch.tensor([0, sharpness], dtype=torch.float32)
elif sharpness.dim() == 1 and sharpness.size(0) == 2:
self.sharpness = torch.tensor([sharpness[0], sharpness[1]], dtype=torch.float32)
else:
raise ValueError(f""sharpness" must be a scalar or a length 2 tensor. Got {sharpness}.")
def __repr__(self) -> str:
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 5
Instances
Project Name: arraiy/torchgeometry
Commit Name: 6ee3f1b0d2a6ebadc9e2f664354594342ab0805d
Time: 2020-11-21
Author: justanhduc@users.noreply.github.com
File Name: kornia/augmentation/augmentation.py
Class Name: RandomSolarize
Method Name: __init__
Project Name: facebookresearch/pytext
Commit Name: 66584dea87782aed5509e4269a9f015002e1f5c1
Time: 2021-02-23
Author: mikekg@fb.com
File Name: pytext/torchscript/module.py
Class Name: PyTextEmbeddingModuleWithDense
Method Name: forward
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c17c92d84ec9216b781ecfbc25c6df225e2fd4f1
Time: 2020-11-11
Author: M.N.Tran@ibm.com
File Name: art/defences/preprocessor/audio_filter_pytorch.py
Class Name: AudioFilterPyTorch
Method Name: __call__
Project Name: arraiy/torchgeometry
Commit Name: 7f0eb809f1509c452d85000fd002b12c22e358ca
Time: 2019-08-22
Author: ducha.aiki@gmail.com
File Name: kornia/filters/kernels.py
Class Name:
Method Name: gaussian
Project Name: facebookresearch/pytext
Commit Name: 1d18d40da194082c2eda8a343ffae85b6c5c634e
Time: 2020-08-20
Author: resteves@fb.com
File Name: pytext/contrib/pytext_lib/models/intent_slot_model.py
Class Name: IntentSlotJointModel
Method Name: forward