MCPcopy
hub / github.com/alibaba/EasyCV / unmap

Function unmap

easycv/utils/misc.py:28–38  ·  view source on GitHub ↗

Unmap a subset of item (data) back to the original set of items (of size count)

(data, count, inds, fill=0)

Source from the content-addressed store, hash-verified

26
27
28def unmap(data, count, inds, fill=0):
29 """ Unmap a subset of item (data) back to the original set of items (of
30 size count) """
31 if data.dim() == 1:
32 ret = data.new_full((count, ), fill)
33 ret[inds] = data
34 else:
35 new_size = (count, ) + data.size()[1:]
36 ret = data.new_full(new_size, fill)
37 ret[inds, :] = data
38 return ret
39
40
41def add_prefix(inputs, prefix):

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected