MCPcopy Create free account
hub / github.com/numpy/numpy / add_close

Function add_close

numpy/core/tests/test_nditer.py:3157–3165  ·  view source on GitHub ↗
(x, y, out=None)

Source from the content-addressed store, hash-verified

3155 ''' using a context amanger and using nditer.close are equivalent
3156 '''
3157 def add_close(x, y, out=None):
3158 addop = np.add
3159 it = np.nditer([x, y, out], [],
3160 [['readonly'], ['readonly'], ['writeonly','allocate']])
3161 for (a, b, c) in it:
3162 addop(a, b, out=c)
3163 ret = it.operands[2]
3164 it.close()
3165 return ret
3166
3167 def add_context(x, y, out=None):
3168 addop = np.add

Callers 1

test_close_equivalentFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected