bf635f90dae66e4ddd3e1f342dca925b3c99faf7,foolbox/attacks/binarization.py,BinarizationRefinementAttack,__call__,#,9

Before Change


        assert o.dtype == x.dtype
        dtype = o.dtype

        if dtype == o.backend.float16:
            nptype = np.float16
        elif dtype == o.backend.float32:
            nptype = np.float32
        elif dtype == o.backend.float64:
            nptype = np.float64
        else:
            raise ValueError(
                "expected dtype to be float16, float32 or float64, found "{dtype}""
            )

        threshold = nptype(threshold)
        offset = nptype(1.0)

        if included_in == "lower":

After Change



        assert o.dtype == x.dtype

        nptype = o.reshape(-1)[0].numpy().dtype.type
        if nptype not in [np.float16, np.float32, np.float64]:
            raise ValueError(
                f"expected dtype to be float16, float32 or float64, found "{nptype}""
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: bethgelab/foolbox
Commit Name: bf635f90dae66e4ddd3e1f342dca925b3c99faf7
Time: 2020-02-11
Author: git@jonasrauber.de
File Name: foolbox/attacks/binarization.py
Class Name: BinarizationRefinementAttack
Method Name: __call__


Project Name: ncullen93/torchsample
Commit Name: 15ac1c2bb2627bb8fbb89b0b64709e9a50be02fd
Time: 2017-05-13
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/tensor_transforms.py
Class Name: ToFile
Method Name: __call__


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 34a5f5229a7477bc03cfbc6cb445b3de0f28244c
Time: 2020-10-14
Author: guillaumekln@users.noreply.github.com
File Name: opennmt/training.py
Class Name: Trainer
Method Name: __call__