MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / concatenate_unique

Function concatenate_unique

tensorflow/python/ops/op_selector.py:43–59  ·  view source on GitHub ↗

Add all the elements of `lb` to `la` if they are not there already. The elements added to `la` maintain ordering with respect to `lb`. Args: la: List of Python objects. lb: List of Python objects. Returns: `la`: The list `la` with missing elements from `lb`.

(la, lb)

Source from the content-addressed store, hash-verified

41
42
43def concatenate_unique(la, lb):
44 """Add all the elements of `lb` to `la` if they are not there already.
45
46 The elements added to `la` maintain ordering with respect to `lb`.
47
48 Args:
49 la: List of Python objects.
50 lb: List of Python objects.
51 Returns:
52 `la`: The list `la` with missing elements from `lb`.
53 """
54 la_set = set(la)
55 for l in lb:
56 if l not in la_set:
57 la.append(l)
58 la_set.add(l)
59 return la
60
61
62def get_tensors(graph):

Callers 1

get_backward_walk_opsFunction · 0.70

Calls 2

appendMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected