MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / _normalization

Method _normalization

PATH/core/models/backbones/vit.py:447–450  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

445
446 @staticmethod
447 def _normalization(x):
448 assert len(x.shape) == 4
449 x = x.sub(torch.tensor([123.675, 116.280, 103.530]).view(1, 3, 1, 1).cuda()).div(torch.tensor([58.395, 57.120, 57.375]).view(1, 3, 1, 1).cuda())
450 return x
451
452 def get_num_layers(self):
453 return len(self.blocks)

Callers 1

forwardMethod · 0.95

Calls 1

cudaMethod · 0.45

Tested by

no test coverage detected