/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
torch
/
include
/
ATen
/
native
/
cuda
/
/usr/local/lib64/python3.6/site-packages/torch/include/ATen/native/cuda
mkdir
upload
Name
Size
Mode
Actions
BatchLinearAlgebraLib.h
3114
0644
edit
dl
rm
block_reduce.cuh
2549
0644
edit
dl
rm
CompositeRandomAccessor.h
929
0644
edit
dl
rm
CUDALoops.cuh
7598
0644
edit
dl
rm
CuFFTPlanCache.h
19282
0644
edit
dl
rm
CuFFTUtils.h
1892
0644
edit
dl
rm
DeviceSqrt.cuh
585
0644
edit
dl
rm
DistributionTemplates.h
27435
0644
edit
dl
rm
EmbeddingBackwardKernel.cuh
715
0644
edit
dl
rm
ForeachFunctors.cuh
16851
0644
edit
dl
rm
GridSampler.cuh
11316
0644
edit
dl
rm
im2col.cuh
6577
0644
edit
dl
rm
KernelUtils.cuh
2553
0644
edit
dl
rm
LaunchUtils.h
306
0644
edit
dl
rm
Loops.cuh
9997
0644
edit
dl
rm
Math.cuh
13840
0644
edit
dl
rm
MemoryAccess.cuh
12463
0644
edit
dl
rm
MiscUtils.h
3341
0644
edit
dl
rm
MultiTensorApply.cuh
7552
0644
edit
dl
rm
Normalization.cuh
74441
0644
edit
dl
rm
PersistentSoftmax.cuh
14635
0644
edit
dl
rm
Randperm.cuh
2114
0644
edit
dl
rm
Reduce.cuh
38784
0644
edit
dl
rm
Resize.cuh
1919
0644
edit
dl
rm
ROCmLoops.cuh
13526
0644
edit
dl
rm
SortingCommon.cuh
5688
0644
edit
dl
rm
SortingRadixSelect.cuh
11918
0644
edit
dl
rm
SortUtils.cuh
5549
0644
edit
dl
rm
TensorModeKernel.cuh
14391
0644
edit
dl
rm
UniqueCub.cuh
345
0644
edit
dl
rm
UpSample.cuh
7552
0644
edit
dl
rm
vol2col.cuh
8297
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/torch/include/ATen/native/cuda/Resize.cuh
(1919B)
#pragma once #include <ATen/ATen.h> #include <THC/THCTensor.hpp> #include <ATen/native/ResizeCommon.h> #include <c10/cuda/CUDAGuard.h> namespace at { namespace native { // These functions are called by native::resize_ as well as (legacy) THC resize. // They are not in THC/THCTensor.cpp because the at namespace is easier // to benchmark than THC; I can't get gbenchmark to call fns from THTensor.cpp static inline void maybe_resize_storage_cuda(TensorImpl* self, uint64_t new_size) { // It does not make sense to try to resize a storage // to hold 0 elements, and this can break // if storage_offset is positive but // new_size is 0, so just bail in that case // (same comment is in Resize.h) if (new_size == 0) { return; } if (!THTensor_getStoragePtr(self)) { TORCH_CHECK(false, "Tensor: invalid null storage"); } uint64_t new_size_bytes = (new_size + self->storage_offset()) * self->dtype().itemsize(); if (new_size_bytes > self->storage().nbytes()) { THCStorage_resizeBytes( globalContext().getTHCState(), THTensor_getStoragePtr(self), new_size_bytes ); } } inline TensorImpl* resize_impl_cuda_( TensorImpl* self, IntArrayRef size, c10::optional<IntArrayRef> stride, bool device_guard = true) { if (self->sizes() == size && (!stride || self->strides() == stride)) { return self; } // NB: We don't need to hold the device guard when calling from TH cuda::OptionalCUDAGuard guard; if (device_guard) { guard.set_index(self->storage().device().index()); } int64_t storage_size = 1; if (stride) { self->set_sizes_and_strides(size, *stride); // NB: storage size can be different from numel. storage_size = storage_size_for(size, *stride); } else { self->set_sizes_contiguous(size); storage_size = self->numel(); } maybe_resize_storage_cuda(self, storage_size); return self; } }}
Save
cmd:
run