diff --git a/caffe2/operators/dataset_ops.cc b/caffe2/operators/dataset_ops.cc index 345a26873e7..ec2e93bc96e 100644 --- a/caffe2/operators/dataset_ops.cc +++ b/caffe2/operators/dataset_ops.cc @@ -399,7 +399,7 @@ class UnPackRecordsOp : public Operator { // input contains a single tensor CAFFE_ENFORCE_EQ(InputSize(), 1); CAFFE_ENFORCE_EQ(OutputSize(), 1); - *Output(0) = Input(0); + Output(0)->CopyFrom(Input(0)); return true; }