)
    return d[str(ind.item())], sm_output[ind] #([predicted class, description], probability)

def benchmark(model, input_shape=(1024, 1, 224, 224), dtype=&#39;fp32&#39;, nwarmup=50, nruns=10000):
    input_data = torch.randn(input_shape)
    input_data = input_data.to(&quot;cuda&quot;)
    if dtype==&#39;fp16&#39;:
        input_data = input_data.half()

    print(&quot;Warm up ...&quot;)
    with torch.no_grad():
        for _ in range(nwarmup):
            features = model(input_data)
    torch.cuda.syn