/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
torch
/
include
/
ATen
/
native
/
/usr/local/lib64/python3.6/site-packages/torch/include/ATen/native
mkdir
upload
Name
Size
Mode
Actions
cpu/
-
0755
rm
cuda/
-
0755
rm
quantized/
-
0755
rm
Activation.h
3069
0644
edit
dl
rm
AdaptivePooling.h
1165
0644
edit
dl
rm
BatchLinearAlgebra.h
8246
0644
edit
dl
rm
batch_norm.h
1285
0644
edit
dl
rm
BinaryOps.h
4916
0644
edit
dl
rm
BucketizationUtils.h
4248
0644
edit
dl
rm
ComplexHelper.h
3797
0644
edit
dl
rm
CompositeRandomAccessor.h
888
0644
edit
dl
rm
CompositeRandomAccessorCommon.h
6713
0644
edit
dl
rm
ConvUtils.h
5350
0644
edit
dl
rm
Copy.h
356
0644
edit
dl
rm
CPUBlas.h
4199
0644
edit
dl
rm
CPUFallback.h
2404
0644
edit
dl
rm
Cross.h
262
0644
edit
dl
rm
DilatedConvolutionUtils.h
6416
0644
edit
dl
rm
DispatchStub.h
7672
0644
edit
dl
rm
Distance.h
732
0644
edit
dl
rm
Distributions.h
21654
0644
edit
dl
rm
DistributionTemplates.h
18623
0644
edit
dl
rm
EmbeddingBag.h
1320
0644
edit
dl
rm
Fill.h
384
0644
edit
dl
rm
ForeachUtils.h
5962
0644
edit
dl
rm
FunctionOfAMatrixUtils.h
436
0644
edit
dl
rm
GridSampler.h
10525
0644
edit
dl
rm
group_norm.h
896
0644
edit
dl
rm
Histogram.h
492
0644
edit
dl
rm
im2col.h
2838
0644
edit
dl
rm
im2col_shape_check.h
6181
0644
edit
dl
rm
IndexingUtils.h
5373
0644
edit
dl
rm
layer_norm.h
2892
0644
edit
dl
rm
Lerp.h
553
0644
edit
dl
rm
LinearAlgebra.h
603
0644
edit
dl
rm
LinearAlgebraUtils.h
25236
0644
edit
dl
rm
LossMulti.h
2197
0644
edit
dl
rm
Math.h
91356
0644
edit
dl
rm
MathBitFallThroughLists.h
4086
0644
edit
dl
rm
MathBitsFallback.h
7326
0644
edit
dl
rm
MaxPooling.h
1234
0644
edit
dl
rm
Normalization.h
302
0644
edit
dl
rm
PointwiseOps.h
749
0644
edit
dl
rm
Pool.h
10922
0644
edit
dl
rm
Pow.h
1694
0644
edit
dl
rm
ReduceAllOps.h
378
0644
edit
dl
rm
ReduceOps.h
1745
0644
edit
dl
rm
ReduceOpsUtils.h
12245
0644
edit
dl
rm
Repeat.h
1286
0644
edit
dl
rm
Resize.h
6501
0644
edit
dl
rm
ResizeCommon.h
1321
0644
edit
dl
rm
RNN.h
2467
0644
edit
dl
rm
ScatterGatherChecks.h
3641
0644
edit
dl
rm
SegmentReduce.h
685
0644
edit
dl
rm
SharedReduceOps.h
15785
0644
edit
dl
rm
SobolEngineOpsUtils.h
1723
0644
edit
dl
rm
Sorting.h
536
0644
edit
dl
rm
SortingUtils.h
5722
0644
edit
dl
rm
SpectralOpsUtils.h
3146
0644
edit
dl
rm
StridedRandomAccessor.h
6847
0644
edit
dl
rm
TensorAdvancedIndexing.h
3072
0644
edit
dl
rm
TensorCompare.h
1333
0644
edit
dl
rm
TensorDimApply.h
1832
0644
edit
dl
rm
TensorFactories.h
3382
0644
edit
dl
rm
TensorIterator.h
46
0644
edit
dl
rm
TensorIteratorDynamicCasting.h
2025
0644
edit
dl
rm
TensorShape.h
1049
0644
edit
dl
rm
TensorTransformations.h
938
0644
edit
dl
rm
TriangularOpsUtils.h
2000
0644
edit
dl
rm
TypeProperties.h
496
0644
edit
dl
rm
UnaryOps.h
4464
0644
edit
dl
rm
Unfold2d.h
551
0644
edit
dl
rm
Unfold3d.h
852
0644
edit
dl
rm
UnfoldBackward.h
5398
0644
edit
dl
rm
UpSample.h
13599
0644
edit
dl
rm
vol2col.h
3642
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/torch/include/ATen/native/im2col_shape_check.h
(6181B)
#include <ATen/ATen.h> #include <ATen/TensorUtils.h> namespace at { namespace native { static inline void col2im_shape_check( const Tensor& input, const Tensor& grad_output, int64_t output_height, int64_t output_width, int64_t kernel_height, int64_t kernel_width, int64_t dilation_height, int64_t dilation_width, int64_t pad_height, int64_t pad_width, int64_t stride_height, int64_t stride_width) { TORCH_CHECK( kernel_width > 0 && kernel_height > 0, "kernel size should be greater than zero, but got kernel_height: ", kernel_height, " kernel_width: ", kernel_width); TORCH_CHECK( stride_width > 0 && stride_height > 0, "stride should be greater than zero, but got stride_height: ", stride_height, " stride_width: ", stride_width); TORCH_CHECK( dilation_width > 0 && dilation_height > 0, "dilation should be greater than zero, but got dilation_height: ", dilation_height, " dilation_width: ", dilation_width); int64_t ndim = input.ndimension(); // allow dim=0 only the batch dimension. TORCH_CHECK( (ndim == 2 && input.size(0) != 0 && input.size(1) != 0) || (ndim == 3 && input.size(1) != 0 && input.size(2) != 0), "Expected 2D or 3D (batch mode) tensor for input with possibly 0 batch size and non-zero dimensions for input, but got: ", input.sizes()); int64_t batch_dim = (ndim == 3) ? 0 : -1; int64_t n_input_plane = input.size(batch_dim + 1); if (n_input_plane % (kernel_width * kernel_height) != 0) { AT_ERROR( "Expected size of input's dimension 1 to be divisible by the " "product of kernel_size, but got input.size(1)=", n_input_plane, " and kernel_size=(", kernel_height, ", ", kernel_width, ")."); } int64_t input_length = input.size(batch_dim + 2); int64_t n_blocks_height = div_rtn<int64_t>( output_height + 2 * pad_height - dilation_height * (kernel_height - 1) - 1, stride_height) + 1; int64_t n_blocks_width = div_rtn<int64_t>( output_width + 2 * pad_width - dilation_width * (kernel_width - 1) - 1, stride_width) + 1; if (input_length != (n_blocks_height * n_blocks_width)) { AT_ERROR( "Given output_size=(", output_height, ", ", output_width, "), kernel_size=(", kernel_height, ", ", kernel_width, "), dilation=(", dilation_height, ", ", dilation_width, "), padding=(", pad_height, ", ", pad_width, "), stride=(", stride_height, ", ", stride_width, "), expected size of input's dimension 2 to match the calculated number of ", "sliding blocks ", n_blocks_height, " * ", n_blocks_width, " = ", (n_blocks_height * n_blocks_width), ", but got input.size(2)=", input_length, "."); } if (output_width < 1 || output_height < 1) { AT_ERROR( "Expected output spatial size to be positive, but got: output_size=(", output_height, ", ", output_width, ")."); } } static inline void im2col_shape_check( const Tensor& input, const Tensor& grad_output, int64_t kernel_height, int64_t kernel_width, int64_t dilation_height, int64_t dilation_width, int64_t pad_height, int64_t pad_width, int64_t stride_height, int64_t stride_width) { TORCH_CHECK( kernel_width > 0 && kernel_height > 0, "kernel size should be greater than zero, but got kernel_height: ", kernel_height, " kernel_width: ", kernel_width); TORCH_CHECK( dilation_width > 0 && dilation_height > 0, "dilation should be greater than zero, but got dilation_height: ", dilation_height, " dilation_width: ", dilation_width); TORCH_CHECK( pad_width >= 0 && pad_height >= 0, "padding should be non-negative, but got pad_height: ", pad_height, " pad_width: ", pad_width); TORCH_CHECK( stride_width > 0 && stride_height > 0, "stride should be greater than zero, but got stride_height: ", stride_height, " stride_width: ", stride_width); int64_t ndim = input.ndimension(); // allow dim=0 only the batch dimension. bool valid_dims = input.size(1) != 0 && input.size(2) != 0; TORCH_CHECK( (ndim == 3 && input.size(0) && valid_dims) || (ndim == 4 && valid_dims && input.size(3) != 0), "Expected 3D or 4D (batch mode) tensor with possibly 0 batch size and other non-zero dimensions for input, but got: ", input.sizes()); int64_t dim_batch = 0; if (ndim == 3) { dim_batch = -1; } int64_t input_height = input.size(dim_batch + 2); int64_t input_width = input.size(dim_batch + 3); int64_t output_height = div_rtn<int64_t>( input_height + 2 * pad_height - (dilation_height * (kernel_height - 1) + 1), stride_height) + 1; int64_t output_width = div_rtn<int64_t>( input_width + 2 * pad_width - (dilation_width * (kernel_width - 1) + 1), stride_width) + 1; if (output_height < 1 || output_width < 1) { AT_ERROR( "Given input with spatial size (", input_height, ", ", input_height, "), kernel_size=(", kernel_height, ", ", kernel_width, "), dilation=(", dilation_height, ", ", dilation_width, "), padding=(", pad_height, ", ", pad_width, "), calculated shape of the array of sliding blocks as (", output_height, ", ", output_width, "), which is too small (non-positive)."); } } } // namespace native } // namespace at
Save
cmd:
run