1db4255e8b19a322434fa2fce398b73b5757f764,examples/1d/compute_speed.py,,,#,19

Before Change


// -----------------------------
// If we"re using the this backend, only compute the benchmark on the GPU.

if backend.NAME == "skcuda":
    device = "gpu"

    fmt_str = "==> Testing Float32 with Skcuda backend, on {}, forward"
    print(fmt_str.format(device.upper()))

    scattering.cuda()
    x_data = x_data.cuda()

    torch.cuda.synchronize()

    t_start = time.time()
    for _ in range(times):
        scattering(x_data)

    torch.cuda.synchronize()

    t_elapsed = time.time() - t_start

    fmt_str = "Elapsed time: {:2f} [s / {:d} evals], avg: {:.2f} (s/batch)"
    print(fmt_str.format(t_elapsed, times, t_elapsed/times))

After Change



if backend.NAME == "torch":
    devices = ["cpu", "gpu"]
elif backend.NAME == "skcuda":
    devices = ["gpu"]

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Create the `Scattering1D` object using the given parameters and generate
// some compatible test data with the specified batch size.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: kymatio/kymatio
Commit Name: 1db4255e8b19a322434fa2fce398b73b5757f764
Time: 2018-11-21
Author: janden@flatironinstitute.org
File Name: examples/1d/compute_speed.py
Class Name:
Method Name:


Project Name: Scitator/catalyst
Commit Name: aab3902d4a7d55f5a86058854adc36b8a12c873f
Time: 2019-05-20
Author: ekhvedchenya@gmail.com
File Name: catalyst/dl/callbacks/base.py
Class Name: OptimizerCallback
Method Name: on_batch_end