MCPcopy Index your code
hub / github.com/HobbitLong/PyContrast / build_mem

Function build_mem

pycontrast/memory/build_memory.py:5–17  ·  view source on GitHub ↗
(opt, n_data)

Source from the content-addressed store, hash-verified

3
4
5def build_mem(opt, n_data):
6 if opt.mem == 'bank':
7 mem_func = RGBMem if opt.modal == 'RGB' else CMCMem
8 memory = mem_func(opt.feat_dim, n_data,
9 opt.nce_k, opt.nce_t, opt.nce_m)
10 elif opt.mem == 'moco':
11 mem_func = RGBMoCo if opt.modal == 'RGB' else CMCMoCo
12 memory = mem_func(opt.feat_dim, opt.nce_k, opt.nce_t)
13 else:
14 raise NotImplementedError(
15 'mem not suported: {}'.format(opt.mem))
16
17 return memory

Callers 1

main_workerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected