Home
last modified time | relevance | path

Searched refs:num_spatial_dims (Results 1 – 25 of 25) sorted by relevance

/external/tensorflow/tensorflow/core/util/
Dtensor_format_test.cc105 GetTensorDimMap(const int num_spatial_dims, const TensorFormat format) { in GetTensorDimMap() argument
107 (format == FORMAT_NHWC) ? DimMaps::kTdmNHWC[num_spatial_dims] : in GetTensorDimMap()
109 format == FORMAT_NCHW_VECT_C) ? DimMaps::kTdmNCHW[num_spatial_dims] in GetTensorDimMap()
114 GetFilterDimMap(const int num_spatial_dims, in GetFilterDimMap() argument
117 (format == FORMAT_HWIO) ? DimMaps::kFdmHWIO[num_spatial_dims] : in GetFilterDimMap()
119 format == FORMAT_OIHW_VECT_I) ? DimMaps::kFdmOIHW[num_spatial_dims] in GetFilterDimMap()
155 template <int num_spatial_dims>
159 auto& tdm = GetTensorDimMap(num_spatial_dims, format); in RunDimensionIndexesTest()
160 int num_dims = GetTensorDimsFromSpatialDims(num_spatial_dims, format); in RunDimensionIndexesTest()
161 LOG(INFO) << ToString(format) << ", num_spatial_dims=" << num_spatial_dims in RunDimensionIndexesTest()
[all …]
Dtensor_format.h109 inline int GetTensorDimsFromSpatialDims(int num_spatial_dims, in GetTensorDimsFromSpatialDims() argument
112 return num_spatial_dims + 3; // Include N,C,InnerC. in GetTensorDimsFromSpatialDims()
114 return num_spatial_dims + 2; // Include N,C. in GetTensorDimsFromSpatialDims()
120 inline int GetFilterTensorDimsFromSpatialDims(int num_spatial_dims, in GetFilterTensorDimsFromSpatialDims() argument
123 return num_spatial_dims + 3; // Include O,I,InnerI. in GetFilterTensorDimsFromSpatialDims()
125 return num_spatial_dims + 2; // Include O,I. in GetFilterTensorDimsFromSpatialDims()
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
Ddepthtospace_op.cc57 int num_spatial_dims = GetTensorSpatialDims(input_rank, data_format_); in Compile() local
67 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
71 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
78 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
80 transpose_order.push_back(i + 1 + num_spatial_dims); in Compile()
82 transpose_order.push_back(feature_dim + num_spatial_dims); in Compile()
85 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
93 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
98 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
103 transpose_order.push_back(1 + num_spatial_dims); in Compile()
[all …]
Dimage_resize_ops.cc79 int num_spatial_dims = in_size.size(); in ComputeResizeConvolutionParameters() local
81 dims.kernel_size.resize(num_spatial_dims); in ComputeResizeConvolutionParameters()
82 dims.stride.resize(num_spatial_dims); in ComputeResizeConvolutionParameters()
83 for (int i = 0; i < num_spatial_dims; ++i) { in ComputeResizeConvolutionParameters()
144 const int num_spatial_dims, std::vector<int64> in_size, in ResizeUsingDilationAndConvolution() argument
161 for (int i = 0; i < num_spatial_dims; ++i) { in ResizeUsingDilationAndConvolution()
166 dimension_numbers.set_kernel_input_feature_dimension(num_spatial_dims); in ResizeUsingDilationAndConvolution()
167 dimension_numbers.set_kernel_output_feature_dimension(num_spatial_dims + 1); in ResizeUsingDilationAndConvolution()
183 for (int i = 0; i < num_spatial_dims; ++i) { in ResizeUsingDilationAndConvolution()
194 const int num_spatial_dims, std::vector<int64> in_size, in ResizeUsingDilationAndConvolutionGradOp() argument
[all …]
Dspacetodepth_op.cc57 int num_spatial_dims = GetTensorSpatialDims(input_rank, data_format_); in Compile() local
67 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
76 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
83 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
86 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
89 transpose_order.push_back(feature_dim + num_spatial_dims); in Compile()
92 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
99 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
109 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
115 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
[all …]
Dextract_image_patches_op.cc42 const int num_spatial_dims = num_dims - 2; in Compile() local
69 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
102 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
107 lhs_shape[num_spatial_dims] = depth; in Compile()
108 lhs_shape[num_spatial_dims + 1] = 1; in Compile()
119 builder->Eq(lhs, iota, {num_spatial_dims + 1}), type); in Compile()
122 std::vector<int64> window_strides(num_spatial_dims); in Compile()
123 std::vector<int64> lhs_dilation(num_spatial_dims, 1); in Compile()
124 std::vector<int64> rhs_dilation(num_spatial_dims); in Compile()
125 std::vector<std::pair<int64, int64>> padding(num_spatial_dims); in Compile()
[all …]
Dpooling_ops.cc38 PoolingOp(OpKernelConstruction* ctx, int num_spatial_dims) in PoolingOp() argument
39 : XlaOpKernel(ctx), num_spatial_dims_(num_spatial_dims) { in PoolingOp()
131 MaxPoolOp(OpKernelConstruction* ctx, int num_spatial_dims) in MaxPoolOp() argument
132 : PoolingOp(ctx, /*num_spatial_dims=*/num_spatial_dims) {} in MaxPoolOp()
181 int num_spatial_dims, TensorFormat data_format) { in AvgPoolDivideByCount() argument
199 std::vector<int64> input_dim_sizes(num_spatial_dims); in AvgPoolDivideByCount()
200 std::vector<int64> window_dims(num_spatial_dims); in AvgPoolDivideByCount()
201 std::vector<int64> window_ksize(num_spatial_dims); in AvgPoolDivideByCount()
202 std::vector<int64> window_stride(num_spatial_dims); in AvgPoolDivideByCount()
203 for (int i = 0; i < num_spatial_dims; ++i) { in AvgPoolDivideByCount()
[all …]
Dconv_ops.cc177 explicit ConvOp(OpKernelConstruction* ctx, int num_spatial_dims, in ConvOp() argument
180 num_spatial_dims_(num_spatial_dims), in ConvOp()
329 explicit ConvBackpropInputOp(OpKernelConstruction* ctx, int num_spatial_dims, in ConvBackpropInputOp() argument
332 num_spatial_dims_(num_spatial_dims), in ConvBackpropInputOp()
487 explicit ConvBackpropFilterOp(OpKernelConstruction* ctx, int num_spatial_dims, in ConvBackpropFilterOp() argument
490 num_spatial_dims_(num_spatial_dims), in ConvBackpropFilterOp()
/external/tensorflow/tensorflow/python/ops/
Dnn_ops.py354 def build_op(num_spatial_dims, padding): argument
355 return lambda inp, _: op(inp, num_spatial_dims, padding)
405 num_spatial_dims = rate_shape[0].value
414 num_spatial_dims + starting_spatial_dim)
440 self.call = build_op(num_spatial_dims, padding)
456 const_filter_shape, num_spatial_dims, rate_or_const_rate)
458 self.num_spatial_dims = num_spatial_dims
462 self.base_paddings = np.zeros([num_spatial_dims, 2], np.int32)
470 self.op = build_op(num_spatial_dims, "VALID")
493 filter_shape, self.num_spatial_dims, self.rate_or_const_rate)
[all …]
/external/tensorflow/tensorflow/compiler/xla/service/cpu/
Dconv_canonicalization.cc44 const int64 num_spatial_dims = dnums.output_spatial_dimensions_size(); in Run() local
45 const int64 num_dims = num_spatial_dims + 2; in Run()
62 for (int64 i = 0; i < num_spatial_dims; ++i) { in Run()
81 for (int64 i = 0; i < num_spatial_dims; ++i) { in Run()
105 for (int64 i = 0; i < num_spatial_dims; ++i) { in Run()
118 for (int64 i = 0; i < num_spatial_dims; ++i) { in Run()
Dir_emission_utils.cc55 const int64 num_spatial_dims = dnums.output_spatial_dimensions_size(); in PotentiallyImplementedAsEigenConvolution() local
56 if (num_spatial_dims > 2) { in PotentiallyImplementedAsEigenConvolution()
60 for (int64 i = 0; i < num_spatial_dims; ++i) { in PotentiallyImplementedAsEigenConvolution()
Dir_emitter.cc1002 int num_spatial_dims = dnums.output_spatial_dimensions_size(); in HandleConvolution() local
1003 std::vector<llvm::Value*> output_spatial(num_spatial_dims); in HandleConvolution()
1004 for (int i = 0; i < num_spatial_dims; ++i) { in HandleConvolution()
1021 std::vector<llvm::Value*> kernel_spatial(num_spatial_dims); in HandleConvolution()
1022 for (int i = 0; i < num_spatial_dims; ++i) { in HandleConvolution()
1055 std::vector<llvm::Value*> input_spatial(num_spatial_dims); in HandleConvolution()
1056 for (int i = 0; i < num_spatial_dims; ++i) { in HandleConvolution()
1077 for (int i = 0; i < num_spatial_dims; ++i) { in HandleConvolution()
1099 for (int i = 0; i < num_spatial_dims; ++i) { in HandleConvolution()
1109 int num_dims = num_spatial_dims + 2; in HandleConvolution()
[all …]
/external/tensorflow/tensorflow/core/kernels/
Dconv_grad_ops.cc98 StringPiece label, int num_spatial_dims, const TensorShape& input_shape, in ConvBackpropComputeDimensionsV2() argument
103 const int num_dims = num_spatial_dims + 2; in ConvBackpropComputeDimensionsV2()
140 dims->spatial_dims.resize(num_spatial_dims); in ConvBackpropComputeDimensionsV2()
141 for (int i = 0; i < num_spatial_dims; ++i) { in ConvBackpropComputeDimensionsV2()
150 Status ConvBackpropComputeDimensions(StringPiece label, int num_spatial_dims, in ConvBackpropComputeDimensions() argument
159 label, num_spatial_dims, input_shape, filter_shape, out_backprop_shape, in ConvBackpropComputeDimensions()
Dconv_grad_ops.h242 Status ConvBackpropComputeDimensions(StringPiece label, int num_spatial_dims,
253 StringPiece label, int num_spatial_dims, const TensorShape& input_shape,
/external/tensorflow/tensorflow/contrib/fused_conv/ops/
Dfused_conv2d_bias_activation_op.cc63 constexpr int num_spatial_dims = 2; in __anonea18cef10102() local
65 GetTensorDimsFromSpatialDims(num_spatial_dims, data_format); in __anonea18cef10102()
71 GetFilterDimIndex<num_spatial_dims>(filter_format, 'O')); in __anonea18cef10102()
/external/tensorflow/tensorflow/core/framework/
Dcommon_shape_fns.cc391 constexpr int num_spatial_dims = 2; in Conv2DShape() local
392 const int rank = GetTensorDimsFromSpatialDims(num_spatial_dims, data_format); in Conv2DShape()
437 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'O')); in Conv2DShape()
439 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'H')); in Conv2DShape()
441 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'W')); in Conv2DShape()
446 GetFilterDimIndex<num_spatial_dims>(filter_format, 'I')), in Conv2DShape()
452 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'I')); in Conv2DShape()
665 constexpr int num_spatial_dims = 2; in AvgPoolShape() local
667 input_shape, GetTensorDimIndex<num_spatial_dims>(data_format, 'N')); in AvgPoolShape()
669 input_shape, GetTensorDimIndex<num_spatial_dims>(data_format, 'H')); in AvgPoolShape()
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/
Datrous_convolution_test.py52 num_spatial_dims = len(rate)
53 spatial_shape = np.array(filters.shape[:num_spatial_dims])
57 output[tuple(np.s_[::rate[i]] for i in range(num_spatial_dims))] = filters
219 …def combined_op(converted_input, num_spatial_dims, padding_arg): # pylint: disable=unused-argument argument
/external/tensorflow/tensorflow/core/ops/
Darray_ops.cc2178 constexpr int num_spatial_dims = 2; in __anon0d47aeef3802() local
2180 GetTensorDimsFromSpatialDims(num_spatial_dims, data_format); in __anon0d47aeef3802()
2188 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'N')); in __anon0d47aeef3802()
2190 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'H')); in __anon0d47aeef3802()
2192 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'W')); in __anon0d47aeef3802()
2194 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'C')); in __anon0d47aeef3802()
2232 constexpr int num_spatial_dims = 2; in __anon0d47aeef3902() local
2234 GetTensorDimsFromSpatialDims(num_spatial_dims, data_format); in __anon0d47aeef3902()
2243 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'N')); in __anon0d47aeef3902()
2245 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'H')); in __anon0d47aeef3902()
[all …]
/external/tensorflow/tensorflow/compiler/xla/service/
Dshape_inference.cc1611 const int num_spatial_dims = dnums.input_spatial_dimensions_size(); in InferConvolveShape() local
1612 if (window.dimensions_size() != num_spatial_dims) { in InferConvolveShape()
1619 const int num_dims = num_spatial_dims + 2; in InferConvolveShape()
1689 std::vector<int64> input_spatial_dims(num_spatial_dims); in InferConvolveShape()
1690 for (int i = 0; i < num_spatial_dims; ++i) { in InferConvolveShape()
1696 std::vector<int64> kernel_spatial_dims(num_spatial_dims); in InferConvolveShape()
1697 for (int i = 0; i < num_spatial_dims; ++i) { in InferConvolveShape()
1714 std::vector<int64> window_dims(num_spatial_dims); in InferConvolveShape()
1715 for (int i = 0; i < num_spatial_dims; ++i) { in InferConvolveShape()
1738 for (int i = 0; i < num_spatial_dims; ++i) { in InferConvolveShape()
Dhlo_evaluator.cc903 const int64 num_spatial_dims = dnums.output_spatial_dimensions_size(); in HandleConvolution() local
904 CHECK_EQ(num_spatial_dims, dnums.input_spatial_dimensions_size()); in HandleConvolution()
905 CHECK_EQ(num_spatial_dims, dnums.kernel_spatial_dimensions_size()); in HandleConvolution()
906 CHECK_GE(num_spatial_dims, 0); in HandleConvolution()
907 CHECK_EQ(window.dimensions_size(), num_spatial_dims); in HandleConvolution()
912 CHECK_EQ(num_spatial_dims + 2, lhs_rank); in HandleConvolution()
913 CHECK_EQ(num_spatial_dims + 2, rhs_rank); in HandleConvolution()
/external/tensorflow/tensorflow/compiler/xla/client/
Dcomputation_builder.cc594 int num_spatial_dims = num_dims - 2; in VerifyConvolution() local
600 if (numbers.size() != num_spatial_dims) { in VerifyConvolution()
602 num_spatial_dims, field_name, in VerifyConvolution()
1513 ComputationBuilder::CreateDefaultConvDimensionNumbers(int num_spatial_dims) { in CreateDefaultConvDimensionNumbers() argument
1523 for (int i = 0; i < num_spatial_dims; ++i) { in CreateDefaultConvDimensionNumbers()
Dcomputation_builder.h366 int num_spatial_dims = 2);
/external/tensorflow/tensorflow/compiler/xla/python/
Dxla_client.py1070 def _GetConvDimensionNumbers(self, num_spatial_dims): argument
1072 nd = num_spatial_dims
/external/tensorflow/tensorflow/compiler/tests/
Drandomized_tests.cc311 WindowedSpatialDims ChooseWindowedSpatialDims(int num_spatial_dims);
576 int num_spatial_dims) { in ChooseWindowedSpatialDims() argument
580 d.kernel_dims.resize(num_spatial_dims); in ChooseWindowedSpatialDims()
581 d.input_dims.resize(num_spatial_dims); in ChooseWindowedSpatialDims()
582 d.output_dims.resize(num_spatial_dims); in ChooseWindowedSpatialDims()
583 d.stride_dims.resize(num_spatial_dims); in ChooseWindowedSpatialDims()
584 for (int i = 0; i < num_spatial_dims; ++i) { in ChooseWindowedSpatialDims()
/external/tensorflow/tensorflow/contrib/layers/python/layers/
Dlayers.py2375 num_spatial_dims = input_rank - 2
2378 window_shape=utils.n_positive_integers(num_spatial_dims, kernel_size),
2382 dilation_rate=utils.n_positive_integers(num_spatial_dims,
2384 strides=utils.n_positive_integers(num_spatial_dims, stride),