Skip to content

Commit

Permalink
Impl. CumlArray.deserialize() (#4965)
Browse files Browse the repository at this point in the history
The "constructor-kwargs" is being removed in rapidsai/cudf#12009

Authors:
  - Mads R. B. Kristensen (https://github.com/madsbk)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #4965
  • Loading branch information
madsbk authored Nov 2, 2022
1 parent 48e1cb7 commit 496f1f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/cuml/common/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,15 @@ def serialize(self) -> Tuple[dict, list]:
frames = [CumlArray(f) for f in frames]
return header, frames

@classmethod
@nvtx.annotate(message="common.CumlArray.deserialize", category="utils",
domain="cuml_python")
def deserialize(cls, header, frames):
assert (
header["frame_count"] == 1
), "Only expecting to deserialize Buffer with a single frame."
return cls(frames[0], **header["constructor-kwargs"])

@nvtx.annotate(message="common.CumlArray.to_host_array", category="utils",
domain="cuml_python")
def to_host_array(self):
Expand Down

0 comments on commit 496f1f1

Please sign in to comment.