Skip to content

Commit 63f23b2

Browse files
committed
deprecate dpctl tensors in sklbench
1 parent d889afd commit 63f23b2

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

sklbench/datasets/transformer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# ===============================================================================
1616

1717
import os
18+
import warnings
1819

1920
import numpy as np
2021
import pandas as pd
@@ -47,6 +48,12 @@ def convert_data(data, dformat: str, order: str, dtype: str, device: str = None)
4748

4849
return dpnp.array(data, dtype=dtype, order=order, device=device)
4950
elif dformat == "dpctl":
51+
warnings.warn(
52+
"dpctl tensors are deprecated and support for them "
53+
"in scikit-learn_bench will be removed. "
54+
"Consider using dpnp arrays instead.",
55+
FutureWarning,
56+
)
5057
import dpctl.tensor
5158

5259
return dpctl.tensor.asarray(data, dtype=dtype, order=order, device=device)

sklbench/utils/common.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import json
2121
import re
2222
import subprocess as sp
23+
import warnings
2324
from pprint import pformat
2425
from shutil import get_terminal_size
2526
from typing import Any, Dict, List, Tuple, Union
@@ -214,6 +215,12 @@ def convert_to_numpy(a, dp_compat=False) -> np.ndarray:
214215

215216
return dpnp.asnumpy(a)
216217
elif "dpctl" in str(type(a)):
218+
warnings.warn(
219+
"dpctl tensors are deprecated and support for them "
220+
"in scikit-learn_bench will be removed. "
221+
"Consider using dpnp arrays instead.",
222+
FutureWarning,
223+
)
217224
import dpctl.tensor
218225

219226
return dpctl.tensor.to_numpy(a)

0 commit comments

Comments
 (0)