From 256a860bbd1d9687477739f8f9a4bd5b327845c3 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Tue, 1 Nov 2022 14:01:03 +0100 Subject: [PATCH] Impl. CumlArray.deserialize() The "constructor-kwargs" is removed in https://github.com/rapidsai/cudf/pull/12009 --- python/cuml/common/array.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/cuml/common/array.py b/python/cuml/common/array.py index ce7897dd2a..9be16ea350 100644 --- a/python/cuml/common/array.py +++ b/python/cuml/common/array.py @@ -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.copy", category="utils", domain="cuml_python") def copy(self) -> Buffer: