MCPcopy Create free account
hub / github.com/Gabesarch/ICAL / normalize

Function normalize

TEACh/utils/basic.py:46–54  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

44 return d
45
46def normalize(d):
47 # d is B x whatever. normalize within each element of the batch
48 out = torch.zeros(d.size())
49 if d.is_cuda:
50 out = out.cuda()
51 B = list(d.size())[0]
52 for b in list(range(B)):
53 out[b] = normalize_single(d[b])
54 return out
55
56def reduce_masked_mean(x, mask, dim=None, keepdim=False):
57 # x and mask are the same shape, or at least broadcastably so

Callers

nothing calls this directly

Calls 2

normalize_singleFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected