The error is most likely raised by the indexing with "Close" so I don’t think it exists.
Could you print the type of it without using any PyTorch methods?
data = pd.read_csv(path)
train_data, val_data, test_data = utilz.split_into_train_val_test(data, 0.7, 0.15, 0.15)
print(type(train_data["Close"]))