Skip to content

Warning when copying a tensor in the base sampler #188

@yukw777

Description

@yukw777

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions