MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / update

Method update

lite/pylite/megenginelite/tensor.py:343–358  ·  view source on GitHub ↗

update the member from C, this will auto used after slice, share

(self)

Source from the content-addressed store, hash-verified

341 return length.value
342
343 def update(self):
344 """
345 update the member from C, this will auto used after slice, share
346 """
347 pinned = c_int()
348 self._api.LITE_is_pinned_host(self._tensor, byref(pinned))
349 self._is_pinned_host = pinned
350 device_type = c_int()
351 self._api.LITE_get_tensor_device_type(self._tensor, byref(device_type))
352 self._device_type = device_type
353 self._api.LITE_get_tensor_layout(self._tensor, byref(self._layout))
354
355 c_types = _lite_dtypes_to_ctype[self._layout.data_type]
356 self.np_array_type = np.ctypeslib._ctype_ndarray(
357 c_types, list(self._layout.shapes)[0 : self._layout.ndim]
358 )
359
360 def copy_from(self, src_tensor):
361 """

Callers 13

wrapperFunction · 0.95
get_io_tensorMethod · 0.95
get_discrete_tensorMethod · 0.95
__init__Method · 0.95
fill_zeroMethod · 0.95
share_memory_withMethod · 0.95
copy_fromMethod · 0.95
reshapeMethod · 0.95
sliceMethod · 0.95
get_data_by_shareMethod · 0.95
to_numpyMethod · 0.95
__repr__Method · 0.95

Calls 1

listFunction · 0.85

Tested by

no test coverage detected