This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cupy as cp # needs to match your cuda toolkit version (See https://docs.cupy.dev/en/stable/install.html#installing-cupy) | |
import numpy as np | |
from pandas import DataFrame | |
class CupyEvaluator: | |
def __init__(self, santa_df: DataFrame, sleigh_weight=10): | |
raw = santa_df.to_numpy() | |
# add 0 padding for indexing (GiftId starts at 1) | |
raw = np.vstack((np.zeros(raw.shape[1]), raw)) | |
# add sleigh weight to northpole position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x2629135b86519d3F7e66e430236de86381c0B701 |