Hy @Mughees , I hope I understand this correctly,
When I run this.
samples = torch.FloatTensor([74891,11865,194148,98997,29350,104203,130637,30649,141300,164775,176567,16267,148950,1536,12022,22100,1566,67277,74877])
a = torch.tensor(1).float() 
step1 = torch.log2(torch.max(samples)/samples)
step2 = torch.max(a,step1)
print(step2)
tensor([1.3743, 4.0324, 1.0000, 1.0000, 2.7257, 1.0000, 1.0000, 2.6632, 1.0000,
        1.0000, 1.0000, 3.5771, 1.0000, 6.9818, 4.0134, 3.1350, 6.9539, 1.5290,
        1.3746])


It gives the desired output.