02b898fffc3a078438f0aa9f8596001af6d28c47,test/common_utils/data_utils.py,,get_whitenoise,#,16
Before Change
if dtype == torch.int32:
tensor *= (tensor > 0) * 2147483647 + (tensor < 0) * 2147483648
if dtype == torch.int16:
tensor *= (tensor > 0) * 32767 + (tensor < 0) * 32768
if dtype == torch.uint8:
tensor *= (tensor > 0) * 127 + (tensor < 0) * 128
tensor += 128
tensor = tensor.to(dtype)
tensor = tensor.repeat([n_channels, 1])
if not channels_first:
tensor = tensor.t()
return tensor.to(device=device)
def get_sinusoid(
*,
After Change
// so we only fork on CPU, generate values and move the data to the given device
with torch.random.fork_rng([]):
torch.random.manual_seed(seed)
tensor = torch.randn([int(sample_rate * duration) ], dtype=torch.float32, device="cpu")
tensor /= 2.0
tensor *= scale_factor
tensor.clamp_(-1.0, 1.0)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: pytorch/audio
Commit Name: 02b898fffc3a078438f0aa9f8596001af6d28c47
Time: 2020-07-16
Author: engineerchuan@gmail.com
File Name: test/common_utils/data_utils.py
Class Name:
Method Name: get_whitenoise
Project Name: PIQuIL/QuCumber
Commit Name: 9587d62e956d178220d345ed16cab42263d8e971
Time: 2019-06-28
Author: emerali@users.noreply.github.com
File Name: qucumber/nn_states/complex_wavefunction.py
Class Name: ComplexWaveFunction
Method Name: __init__
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 3bf391c2315bcec722961a2f4a093d1c516dbb10
Time: 2018-08-29
Author: Maria-Irina.Nicolae@ibm.com
File Name: art/classifiers/pytorch.py
Class Name: PyTorchClassifier
Method Name: __init__