MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / __new__

Method __new__

python/graphvite/util.py:95–105  ·  view source on GitHub ↗
(cls, array)

Source from the content-addressed store, hash-verified

93 array (array-like): input data
94 """
95 def __new__(cls, array):
96 if "linux" not in sys.platform:
97 raise EnvironmentError("SharedNDArray only works on Linux")
98
99 array = np.asarray(array)
100 file = tempfile.NamedTemporaryFile()
101 self = super(SharedNDArray, cls).__new__(cls, file, dtype=array.dtype, shape=array.shape)
102 # keep reference to the tmp file, otherwise it will be released
103 self.file = file
104 self[:] = array
105 return self
106
107 @classmethod
108 def from_memmap(cls, *args, **kwargs):

Callers 1

from_memmapMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected