MCPcopy Create free account
hub / github.com/SLDGroup/EMCAD / powerset

Function powerset

utils/utils.py:20–30  ·  view source on GitHub ↗

Returns all the subsets of this set. This is a generator.

(seq)

Source from the content-addressed store, hash-verified

18from ptflops import get_model_complexity_info
19
20def powerset(seq):
21 """
22 Returns all the subsets of this set. This is a generator.
23 """
24 if len(seq) <= 1:
25 yield seq
26 yield []
27 else:
28 for item in powerset(seq[1:]):
29 yield [seq[0]]+item
30 yield item
31
32def clip_gradient(optimizer, grad_clip):
33 """

Callers 1

trainer_synapseFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected