default options for OutputTensorCopyFrom (#15248)
authorJerry Zhang <jerryzh@fb.com>
Thu, 20 Dec 2018 02:10:36 +0000 (18:10 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 20 Dec 2018 02:14:47 +0000 (18:14 -0800)
commit5dd5ef3214c77b8683361dbda087cded855bbce3
tree95150eb8874aaf17d15c2a64ee81ae8a58819afa
parenta00cfd1e9b05447d522ef8a3bc240127043d46d7
default options for OutputTensorCopyFrom (#15248)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15248

OutputTensorCopyFrom takes four arguments: index, a source Tensor, TensorOptions and whether we want to perform an async call.
We want to provide some default option for TensorOptions, (1). default device to context_.device() (2). default dtype to input.dtype(). User can also explicitly provide these options to override default values.

next diff will change the order of TensorOptions parameter so that user don't need to write down tensor options unless they want to override.

Reviewed By: dzhulgakov

Differential Revision: D13453824

fbshipit-source-id: 87401f81c7c3f9fd3d8936c710e6c2e04a59b689
caffe2/core/operator.h