MCPcopy Create free account
hub / github.com/mpi4py/mpi4py / __init__

Method __init__

test/arrayimpl.py:375–387  ·  view source on GitHub ↗
(self, arg, typecode, shape=None, readonly=False)

Source from the content-addressed store, hash-verified

373 TypeMap.pop("G", None)
374
375 def __init__(self, arg, typecode, shape=None, readonly=False):
376 if isinstance(arg, (int, float, complex)):
377 if shape is None:
378 shape = ()
379 else:
380 if shape is None:
381 shape = len(arg)
382 self.array = cupy.zeros(shape, typecode)
383 if isinstance(arg, (int, float, complex)):
384 self.array.fill(arg)
385 else:
386 self.array[:] = cupy.asarray(arg, typecode)
387 del readonly # self.array.flags.readonly = readonly
388
389 @property
390 def address(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected