flambe icon indicating copy to clipboard operation
flambe copied to clipboard

Warning when copying a tensor in the base sampler

Open yukw777 opened this issue 5 years ago • 0 comments

Describe the bug The base sampler produces the following warning:

py.warnings [block_train] /home/ubuntu/.local/lib/python3.6/site-packages/flambe/sampler/base.py:167: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().re
quires_grad_(True), rather than torch.tensor(sourceTensor).
  tensors = [torch.tensor(example) for example in column]

To Reproduce Steps to reproduce the behavior: Simply run the base sampler with verbose logging.

Expected behavior There should be no warning.

Screenshots N/A

Software Versions (please complete the following information):

  • OS: Ubuntu 18.04
  • Python Version 3.6.8
  • PyTorch Version 1.1
  • Flambé Version 0.4.8

Additional context N/A

yukw777 avatar Dec 23 '19 18:12 yukw777