pyg-team / pytorch-frame

Tabular Deep Learning Library for PyTorch
https://pytorch-frame.readthedocs.io
MIT License
505 stars 53 forks source link

[UserWarning] Fixing UserWarnings in two tests. #409

Closed drivanov closed 3 months ago

drivanov commented 3 months ago

The following UserWarnings are fixed:

test/transforms/test_cat_to_num_transform.py::test_cat_to_num_transform_on_categorical_only_dataset[True]
test/transforms/test_cat_to_num_transform.py::test_cat_to_num_transform_on_categorical_only_dataset[False]
  /opt/pyg/pytorch-frame/test/transforms/test_cat_to_num_transform.py:55: UserWarning: To copy construct from a tensor, 
it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather 
than torch.tensor(sourceTensor).
    assert torch.allclose(

test/transforms/test_cat_to_num_transform.py::test_cat_to_num_transform_with_loading[TaskType.REGRESSION]
test/transforms/test_cat_to_num_transform.py::test_cat_to_num_transform_with_loading[TaskType.BINARY_CLASSIFICATION]
  /opt/pyg/pytorch-frame/test/transforms/test_cat_to_num_transform.py:138: UserWarning: To copy construct from a tensor, 
it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather 
than torch.tensor(sourceTensor).
    assert torch.allclose(