diff options
author | Jerry Zhang <jerryzh@fb.com> | 2018-10-29 11:09:15 -0700 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2018-10-29 11:11:19 -0700 |
commit | dcbca53e58f1661216e716177cdb87590281cb34 (patch) | |
tree | 697ae30cbc0fcb1c8f30aa867a8b873bf42abfb1 /caffe2/ideep | |
parent | b1cf3ad1c2f62ccca241cfb6885b7716a348467f (diff) | |
download | pytorch-dcbca53e58f1661216e716177cdb87590281cb34.tar.gz pytorch-dcbca53e58f1661216e716177cdb87590281cb34.tar.bz2 pytorch-dcbca53e58f1661216e716177cdb87590281cb34.zip |
Renaming size() to numel() - 1/6
Summary: Codemod generated with clangr shard mode, 50 files per diff
Reviewed By: li-roy
Differential Revision: D10866373
fbshipit-source-id: 589194164d4fea93b74d83fa7fc4c59558c41f4a
Diffstat (limited to 'caffe2/ideep')
-rw-r--r-- | caffe2/ideep/operators/concat_split_op.cc | 2 | ||||
-rw-r--r-- | caffe2/ideep/operators/momentum_sgd_op.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/caffe2/ideep/operators/concat_split_op.cc b/caffe2/ideep/operators/concat_split_op.cc index 7b021aea5f..df3039ca31 100644 --- a/caffe2/ideep/operators/concat_split_op.cc +++ b/caffe2/ideep/operators/concat_split_op.cc @@ -98,7 +98,7 @@ class IDEEPSplitOp final : public IDEEPOperator { "If you set split with an input blob, do not pass in " "split in the argument."); auto& axis_info = OperatorBase::Input<Tensor>(AXIS_INFO, CPU); - CAFFE_ENFORCE_EQ(axis_info.size(), OutputSize()); + CAFFE_ENFORCE_EQ(axis_info.numel(), OutputSize()); auto* axis_data = axis_info.template data<int>(); axis_vdata.assign(axis_data, axis_data + OutputSize()); } else if (axis_offset_.size() == 0) { diff --git a/caffe2/ideep/operators/momentum_sgd_op.cc b/caffe2/ideep/operators/momentum_sgd_op.cc index 320780c12f..226120e3ba 100644 --- a/caffe2/ideep/operators/momentum_sgd_op.cc +++ b/caffe2/ideep/operators/momentum_sgd_op.cc @@ -55,7 +55,7 @@ class IDEEPMomentumSGDOp final : public IDEEPOperator { // TODO: Use itensor after 0-dim is supported. Now use CPU tensor. const auto& lr = OperatorBase::Input<TensorCPU>(LR, CPU); - CAFFE_ENFORCE(lr.size() == 1); + CAFFE_ENFORCE(lr.numel() == 1); momentum_sgd_update( Input(GRAD).get_nelems(), @@ -97,7 +97,7 @@ class IDEEPMomentumSGDUpdateOp final : public IDEEPOperator { // TODO: Use itensor after 0-dim is supported. Now use CPU tensor. const auto& lr = OperatorBase::Input<TensorCPU>(LR, CPU); - CAFFE_ENFORCE(lr.size() == 1); + CAFFE_ENFORCE(lr.numel() == 1); momentum_sgd_update( Input(GRAD).get_nelems(), |