Describe the purpose of the pull request, including:
Added the buffer.from_numpy parameter to let the user decide which function to use to convert Numpy arrays into PyTorch tensors when the to_tensor() and sample_tensors() functions are called.
In particular, it is used the torch.from_numpy() function when buffer.from_numpy=True, otherwise the torch.as_tensor() function.
Type of Change
Please select the one relevant option below:
New feature (non-breaking change that adds functionality)
Checklist
Please confirm that the following tasks have been completed:
[x] I have tested my changes locally and they work as expected. (Please describe the tests you performed.)
[x] I have added unit tests for my changes, or updated existing tests if necessary.
[x] I have updated the documentation, if applicable.
[x] I have installed pre-commit and run locally for my code changes.
Summary
Describe the purpose of the pull request, including:
buffer.from_numpy
parameter to let the user decide which function to use to convert Numpy arrays into PyTorch tensors when theto_tensor()
andsample_tensors()
functions are called. In particular, it is used thetorch.from_numpy()
function whenbuffer.from_numpy=True
, otherwise thetorch.as_tensor()
function.Type of Change
Please select the one relevant option below:
Checklist
Please confirm that the following tasks have been completed: