From: Iurii Zdebskyi Date: Sun, 24 Mar 2019 15:17:34 +0000 (-0700) Subject: Removed some dead code (#18201) X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~659 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1323c193edf97075bab63759cf0f353b7e7baa2d;p=platform%2Fupstream%2Fpytorch.git Removed some dead code (#18201) Summary: Removed some dead code. Pull Request resolved: https://github.com/pytorch/pytorch/pull/18201 Differential Revision: D14555251 Pulled By: izdeby fbshipit-source-id: f49640133ef4ae1b0306f7cec6655f23869cc6e7 --- diff --git a/aten/src/TH/generic/THTensorRandom.cpp b/aten/src/TH/generic/THTensorRandom.cpp index 5973e5b..43c68d6 100644 --- a/aten/src/TH/generic/THTensorRandom.cpp +++ b/aten/src/TH/generic/THTensorRandom.cpp @@ -55,12 +55,6 @@ void THTensor_(cappedRandom)(THTensor *self, THGenerator *_generator, int64_t ma THTensor_(clampedRandom)(self, _generator, 0, max); } -void THTensor_(geometric)(THTensor *self, THGenerator *_generator, double p) -{ - std::lock_guard lock(_generator->mutex); - TH_TENSOR_APPLY(scalar_t, self, *self_data = (scalar_t)THRandom_geometric(_generator, p);); -} - #if defined(TH_REAL_IS_FLOAT) || defined(TH_REAL_IS_DOUBLE) #if defined(TH_REAL_IS_FLOAT) diff --git a/aten/src/TH/generic/THTensorRandom.h b/aten/src/TH/generic/THTensorRandom.h index 4dd22e2..d52f34a 100644 --- a/aten/src/TH/generic/THTensorRandom.h +++ b/aten/src/TH/generic/THTensorRandom.h @@ -5,7 +5,6 @@ TH_API void THTensor_(random)(THTensor *self, THGenerator *_generator); TH_API void THTensor_(clampedRandom)(THTensor *self, THGenerator *_generator, int64_t min, int64_t max); TH_API void THTensor_(cappedRandom)(THTensor *self, THGenerator *_generator, int64_t max); -TH_API void THTensor_(geometric)(THTensor *self, THGenerator *_generator, double p); #if defined(TH_REAL_IS_FLOAT) || defined(TH_REAL_IS_DOUBLE) TH_API void THTensor_(bernoulli_Tensor)(THTensor *self, THGenerator *_generator, THTensor *p); diff --git a/aten/src/THC/generic/THCTensorMath.cu b/aten/src/THC/generic/THCTensorMath.cu index 9976a4b..d3dbb9a 100644 --- a/aten/src/THC/generic/THCTensorMath.cu +++ b/aten/src/THC/generic/THCTensorMath.cu @@ -35,20 +35,6 @@ void THCTensor_(zero)(THCState *state, THCTensor *self_) THCudaCheck(cudaGetLastError()); } -void THCTensor_(zerosLike)(THCState *state, THCTensor *r_, THCTensor *input) -{ - THCAssertSameGPU(THCTensor_(checkGPU)(state, 2, r_, input)); - THCTensor_(resizeAs)(state, r_, input); - THCTensor_(zero)(state, r_); -} - -void THCTensor_(onesLike)(THCState *state, THCTensor *r_, THCTensor *input) -{ - THCAssertSameGPU(THCTensor_(checkGPU)(state, 2, r_, input)); - THCTensor_(resizeAs)(state, r_, input); - THCTensor_(fill)(state, r_, ScalarConvert::to(1)); -} - ptrdiff_t THCTensor_(numel)(THCState *state, THCTensor *t) { @@ -368,28 +354,6 @@ void THCTensor_(diag)(THCState *state, THCTensor *self_, THCTensor *src_, int64_ THCudaCheck(cudaGetLastError()); } -void THCTensor_(eye)(THCState *state, THCTensor *self_, int64_t n, int64_t m) -{ - THCAssertSameGPU(THCTensor_(checkGPU)(state, 1, self_)); - THArgCheck(n > 0, 1, "invalid argument"); - - if(m <= 0) - m = n; - - THCTensor_(resize2d)(state, self_, n, m); - THCTensor_(zero)(state, self_); - - int64_t sz = THMin(n, m); - int64_t stride = THCTensor_(stride)(state, self_, 0) + - THCTensor_(stride)(state, self_, 1); - - THCTensor *diag = THCTensor_(newWithStorage1d)(state, THTensor_getStoragePtr(self_), - self_->storage_offset(), sz, stride); - - THCTensor_(fill)(state, diag, ScalarConvert::to(1)); - THCTensor_(free)(state, diag); -} - accreal THCTensor_(trace)(THCState *state, THCTensor *src_) { THCAssertSameGPU(THCTensor_(checkGPU)(state, 1, src_)); THArgCheck((THTensor_nDimensionLegacyAll(src_) == 2), 1, "expected a matrix");