summaryrefslogtreecommitdiff
path: root/modules/detectron
diff options
context:
space:
mode:
authorChristian Puhrsch <cpuhrsch@fb.com>2018-09-22 18:07:38 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-09-22 18:11:04 -0700
commita6630e25afb49642cf517ee948f5a0c06a9cba6d (patch)
tree9b8e21397d409ae522d8d50c7bfa78f22f48ae52 /modules/detectron
parent5d0f1c3c8ff4cb14bdf554b447d6851877d710ac (diff)
downloadpytorch-a6630e25afb49642cf517ee948f5a0c06a9cba6d.tar.gz
pytorch-a6630e25afb49642cf517ee948f5a0c06a9cba6d.tar.bz2
pytorch-a6630e25afb49642cf517ee948f5a0c06a9cba6d.zip
Remove many caffe2::TIndex and replace them with int64_t (#11943)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/11943 See title Reviewed By: ezyang Differential Revision: D9992645 fbshipit-source-id: e8f80d6ea762971513e5e8072975ceea53e1f11a
Diffstat (limited to 'modules/detectron')
-rw-r--r--modules/detectron/sample_as_op.cu2
-rw-r--r--modules/detectron/select_smooth_l1_loss_op.cu2
-rw-r--r--modules/detectron/sigmoid_cross_entropy_loss_op.cu6
-rw-r--r--modules/detectron/sigmoid_focal_loss_op.cu2
-rw-r--r--modules/detectron/smooth_l1_loss_op.cu2
-rw-r--r--modules/detectron/softmax_focal_loss_op.cu2
-rw-r--r--modules/detectron/upsample_nearest_op.cu2
7 files changed, 9 insertions, 9 deletions
diff --git a/modules/detectron/sample_as_op.cu b/modules/detectron/sample_as_op.cu
index 43ebaa2740..910d1ba3eb 100644
--- a/modules/detectron/sample_as_op.cu
+++ b/modules/detectron/sample_as_op.cu
@@ -58,7 +58,7 @@ bool SampleAsOp<float, CUDAContext>::RunOnDevice() {
assert(count > 0);
// resize Y
- vector<TIndex> out_shape(X.dims());
+ vector<int64_t> out_shape(X.dims());
out_shape[0] = count;
Y->Resize(out_shape);
diff --git a/modules/detectron/select_smooth_l1_loss_op.cu b/modules/detectron/select_smooth_l1_loss_op.cu
index 98dc0bc4fa..259f89297f 100644
--- a/modules/detectron/select_smooth_l1_loss_op.cu
+++ b/modules/detectron/select_smooth_l1_loss_op.cu
@@ -99,7 +99,7 @@ bool SelectSmoothL1LossOp<float, CUDAContext>::RunOnDevice() {
auto& S = Input(3);
auto* avg_loss = Output(0);
- avg_loss->Resize(vector<TIndex>());
+ avg_loss->Resize(vector<int64_t>());
if (Y.size() == 0){
math::Set<float, CUDAContext>(
1, static_cast<float>(0), avg_loss->mutable_data<float>(), &context_);
diff --git a/modules/detectron/sigmoid_cross_entropy_loss_op.cu b/modules/detectron/sigmoid_cross_entropy_loss_op.cu
index eb3bd97181..a8b639058c 100644
--- a/modules/detectron/sigmoid_cross_entropy_loss_op.cu
+++ b/modules/detectron/sigmoid_cross_entropy_loss_op.cu
@@ -79,10 +79,10 @@ bool SigmoidCrossEntropyLossOp<float, CUDAContext>::RunOnDevice() {
" vs. ",
T.size(),
")");
- avg_loss->Resize(vector<TIndex>());
+ avg_loss->Resize(vector<int64_t>());
counts_.ResizeLike(X);
losses_.ResizeLike(X);
- normalizer_.Resize(vector<TIndex>());
+ normalizer_.Resize(vector<int64_t>());
SigmoidCrossEntropyLossKernel<<<
CAFFE_GET_BLOCKS(X.size()),
CAFFE_CUDA_NUM_THREADS,
@@ -124,7 +124,7 @@ bool SigmoidCrossEntropyLossGradientOp<float, CUDAContext>::RunOnDevice() {
dX->ResizeLike(X);
counts_.ResizeLike(X);
- normalizer_.Resize(vector<TIndex>());
+ normalizer_.Resize(vector<int64_t>());
SigmoidCrossEntropyLossGradientKernel<<<
CAFFE_GET_BLOCKS(X.size()),
CAFFE_CUDA_NUM_THREADS,
diff --git a/modules/detectron/sigmoid_focal_loss_op.cu b/modules/detectron/sigmoid_focal_loss_op.cu
index 0b7b4011ba..2630cf37b1 100644
--- a/modules/detectron/sigmoid_focal_loss_op.cu
+++ b/modules/detectron/sigmoid_focal_loss_op.cu
@@ -125,7 +125,7 @@ bool SigmoidFocalLossOp<float, CUDAContext>::RunOnDevice() {
int H = X.dim32(2);
int W = X.dim32(3);
- avg_loss->Resize(vector<TIndex>());
+ avg_loss->Resize(vector<int64_t>());
losses_.ResizeLike(X);
float* avg_loss_data = avg_loss->mutable_data<float>();
diff --git a/modules/detectron/smooth_l1_loss_op.cu b/modules/detectron/smooth_l1_loss_op.cu
index 7ded2802dd..30aadc5f45 100644
--- a/modules/detectron/smooth_l1_loss_op.cu
+++ b/modules/detectron/smooth_l1_loss_op.cu
@@ -78,7 +78,7 @@ bool SmoothL1LossOp<float, CUDAContext>::RunOnDevice() {
CAFFE_ENFORCE_EQ(Y_hat.size(), alpha_in.size());
CAFFE_ENFORCE_EQ(Y_hat.size(), alpha_out.size());
- avg_loss->Resize(vector<TIndex>());
+ avg_loss->Resize(vector<int64_t>());
buff_.ResizeLike(Y);
// Difference
diff --git a/modules/detectron/softmax_focal_loss_op.cu b/modules/detectron/softmax_focal_loss_op.cu
index 8b6d1dd178..72b24aeb9f 100644
--- a/modules/detectron/softmax_focal_loss_op.cu
+++ b/modules/detectron/softmax_focal_loss_op.cu
@@ -158,7 +158,7 @@ bool SoftmaxFocalLossOp<float, CUDAContext>::RunOnDevice() {
losses_.Resize(N * A * H * W);
P->Resize(N * D * H * W);
- avg_loss->Resize(vector<TIndex>());
+ avg_loss->Resize(vector<int64_t>());
math::Set<float, CUDAContext>(
avg_loss->size(), 0.f, avg_loss->mutable_data<float>(), &context_);
math::Set<float, CUDAContext>(
diff --git a/modules/detectron/upsample_nearest_op.cu b/modules/detectron/upsample_nearest_op.cu
index 2afff9719f..870f0508dd 100644
--- a/modules/detectron/upsample_nearest_op.cu
+++ b/modules/detectron/upsample_nearest_op.cu
@@ -125,7 +125,7 @@ bool UpsampleNearestOp<float, CUDAContext>::RunOnDevice() {
auto& X = Input(0);
auto* Y = Output(0);
- vector<TIndex> out_shape;
+ vector<int64_t> out_shape;
for (int i = 0; i < X.ndim(); ++i) {
out_shape.push_back(X.dim32(i));
}