Home
last modified time | relevance | path

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

12

/external/tensorflow/tensorflow/core/util/
Dtensor_format_test.cc115 GetTensorDimMap(const int num_spatial_dims, const TensorFormat format) { in GetTensorDimMap() argument
118 format == FORMAT_NHWC_VECT_W) ? DimMaps::kTdmNHWC[num_spatial_dims] : in GetTensorDimMap()
120 format == FORMAT_NCHW_VECT_C) ? DimMaps::kTdmNCHW[num_spatial_dims] : in GetTensorDimMap()
121 (format == FORMAT_HWNC) ? DimMaps::kTdmHWNC[num_spatial_dims] : in GetTensorDimMap()
122 (format == FORMAT_HWCN) ? DimMaps::kTdmHWCN[num_spatial_dims] in GetTensorDimMap()
127 GetFilterDimMap(const int num_spatial_dims, in GetFilterDimMap() argument
130 (format == FORMAT_HWIO) ? DimMaps::kFdmHWIO[num_spatial_dims] : in GetFilterDimMap()
132 format == FORMAT_OIHW_VECT_I) ? DimMaps::kFdmOIHW[num_spatial_dims] in GetFilterDimMap()
170 template <int num_spatial_dims>
174 auto& tdm = GetTensorDimMap(num_spatial_dims, format); in RunDimensionIndexesTest()
[all …]
Dtensor_format.h144 inline int GetTensorDimsFromSpatialDims(int num_spatial_dims, in GetTensorDimsFromSpatialDims() argument
151 return num_spatial_dims + 2; // Include N,C. in GetTensorDimsFromSpatialDims()
154 return num_spatial_dims + 3; // Include N,C,VectDim. in GetTensorDimsFromSpatialDims()
163 inline int GetFilterTensorDimsFromSpatialDims(int num_spatial_dims, in GetFilterTensorDimsFromSpatialDims() argument
166 return num_spatial_dims + 3; // Include O,I,InnerI. in GetFilterTensorDimsFromSpatialDims()
168 return num_spatial_dims + 2; // Include O,I. in GetFilterTensorDimsFromSpatialDims()
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
Dconv_op_helpers.cc66 int num_spatial_dims) { in TransposeFilterForGroupConvolutionBackpropInput() argument
79 std::swap(transpose_dims[num_spatial_dims], in TransposeFilterForGroupConvolutionBackpropInput()
80 transpose_dims[num_spatial_dims + 1]); in TransposeFilterForGroupConvolutionBackpropInput()
84 result = xla::Collapse(result, {num_spatial_dims, num_spatial_dims + 1}); in TransposeFilterForGroupConvolutionBackpropInput()
100 const int num_dims = attrs.num_spatial_dims + 2; in CheckConvAttrs()
123 for (int i = 0; i < attrs.num_spatial_dims; ++i) { in CheckConvAttrs()
137 StringPiece label, int num_spatial_dims, const xla::Shape& input_shape, in ConvBackpropComputeDimensionsV2XlaShapes() argument
149 label, num_spatial_dims, input_tensor_shape, filter_tensor_shape, in ConvBackpropComputeDimensionsV2XlaShapes()
160 xla::StatusOr<ConvOpAttrs> ConvOpAttrs::Create(int num_spatial_dims, in Create() argument
164 attrs.num_spatial_dims = num_spatial_dims; in Create()
[all …]
Ddepthtospace_op.cc70 int num_spatial_dims = GetTensorSpatialDims(input_rank, data_format); in Compile() local
80 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
84 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
91 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
93 transpose_order.push_back(i + 1 + num_spatial_dims); in Compile()
95 transpose_order.push_back(feature_dim + num_spatial_dims); in Compile()
98 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
106 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
111 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
116 transpose_order.push_back(1 + num_spatial_dims); in Compile()
[all …]
Dspacetodepth_op.cc70 int num_spatial_dims = GetTensorSpatialDims(input_rank, data_format); in Compile() local
80 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
89 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
96 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
99 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
102 transpose_order.push_back(feature_dim + num_spatial_dims); in Compile()
105 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
112 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
122 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
128 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
[all …]
Dextract_image_patches_op.cc50 const int num_spatial_dims = num_dims - 2; in Compile() local
77 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
110 for (int i = 0; i < num_spatial_dims; ++i) { in Compile()
115 kernel_shape[num_spatial_dims] = 1; in Compile()
116 kernel_shape[num_spatial_dims + 1] = kernel_size * depth; in Compile()
127 std::vector<int64> window_strides(num_spatial_dims); in Compile()
128 std::vector<int64> lhs_dilation(num_spatial_dims, 1); in Compile()
129 std::vector<int64> rhs_dilation(num_spatial_dims); in Compile()
130 std::vector<std::pair<int64, int64>> padding(num_spatial_dims); in Compile()
136 dims.set_kernel_input_feature_dimension(num_spatial_dims); in Compile()
[all …]
Dimage_resize_ops.cc90 int num_spatial_dims = in_size.size(); in ComputeResizeConvolutionParameters() local
92 dims.kernel_size.resize(num_spatial_dims); in ComputeResizeConvolutionParameters()
93 dims.stride.resize(num_spatial_dims); in ComputeResizeConvolutionParameters()
94 for (int i = 0; i < num_spatial_dims; ++i) { in ComputeResizeConvolutionParameters()
233 const int num_spatial_dims, absl::Span<const int64> in_size, in ResizeUsingDilationAndConvolution() argument
249 dimension_numbers.set_input_feature_dimension(num_spatial_dims + 1); in ResizeUsingDilationAndConvolution()
250 dimension_numbers.set_output_feature_dimension(num_spatial_dims + 1); in ResizeUsingDilationAndConvolution()
251 for (int i = 0; i < num_spatial_dims; ++i) { in ResizeUsingDilationAndConvolution()
256 dimension_numbers.set_kernel_input_feature_dimension(num_spatial_dims + 1); in ResizeUsingDilationAndConvolution()
257 dimension_numbers.set_kernel_output_feature_dimension(num_spatial_dims); in ResizeUsingDilationAndConvolution()
[all …]
Dconv_ops.cc45 explicit ConvOp(OpKernelConstruction* ctx, int num_spatial_dims, in ConvOp() argument
49 ConvOpAttrs::Create(num_spatial_dims, depthwise, ctx); in ConvOp()
96 explicit ConvBackpropInputOp(OpKernelConstruction* ctx, int num_spatial_dims, in ConvBackpropInputOp() argument
100 ConvOpAttrs::Create(num_spatial_dims, depthwise, ctx); in ConvBackpropInputOp()
110 OP_REQUIRES(ctx, input_shape.rank() == attrs_.num_spatial_dims + 2, in Compile()
114 attrs_.num_spatial_dims + 2, " got ", input_shape.rank())); in Compile()
162 explicit ConvBackpropFilterOp(OpKernelConstruction* ctx, int num_spatial_dims, in ConvBackpropFilterOp() argument
166 ConvOpAttrs::Create(num_spatial_dims, depthwise, ctx); in ConvBackpropFilterOp()
Dpooling_ops.cc43 PoolingOp(OpKernelConstruction* ctx, int num_spatial_dims, in PoolingOp() argument
46 num_spatial_dims_(num_spatial_dims), in PoolingOp()
138 int num_spatial_dims) { in XlaTensorFormat() argument
139 int num_dims = num_spatial_dims + 2; in XlaTensorFormat()
142 absl::InlinedVector<int64, 4> spatial_dimensions(num_spatial_dims); in XlaTensorFormat()
143 for (int spatial_dim = 0; spatial_dim < num_spatial_dims; ++spatial_dim) { in XlaTensorFormat()
154 MaxPoolOp(OpKernelConstruction* ctx, int num_spatial_dims) in MaxPoolOp() argument
155 : PoolingOp(ctx, /*num_spatial_dims=*/num_spatial_dims, in MaxPoolOp()
212 AvgPoolOp(OpKernelConstruction* ctx, int num_spatial_dims) in AvgPoolOp() argument
213 : PoolingOp(ctx, /*num_spatial_dims=*/num_spatial_dims, in AvgPoolOp()
[all …]
Dconv_op_helpers.h46 static xla::StatusOr<ConvOpAttrs> Create(int num_spatial_dims, bool depthwise,
50 int num_spatial_dims; member
/external/tensorflow/tensorflow/compiler/xla/client/lib/
Dpooling.cc35 const int num_spatial_dims = spatial_padding.size(); in AvgPoolDivideByCountWithGeneralPadding() local
37 std::vector<int64> input_dim_sizes(num_spatial_dims); in AvgPoolDivideByCountWithGeneralPadding()
38 std::vector<int64> window_dims(num_spatial_dims); in AvgPoolDivideByCountWithGeneralPadding()
39 std::vector<int64> window_ksize(num_spatial_dims); in AvgPoolDivideByCountWithGeneralPadding()
40 std::vector<int64> window_stride(num_spatial_dims); in AvgPoolDivideByCountWithGeneralPadding()
41 CHECK_EQ(data_format.num_spatial_dims(), num_spatial_dims) in AvgPoolDivideByCountWithGeneralPadding()
43 for (int i = 0; i < num_spatial_dims; ++i) { in AvgPoolDivideByCountWithGeneralPadding()
55 for (int i = 0; i < num_spatial_dims; ++i) { in AvgPoolDivideByCountWithGeneralPadding()
91 int num_spatial_dims, absl::Span<const int64> stride, in MakeSpatialPaddingConfig() argument
94 padding_config.mutable_dimensions()->Reserve(2 + num_spatial_dims); in MakeSpatialPaddingConfig()
[all …]
Dpooling_test.cc25 TensorFormat MakeNCHWFormat(int num_spatial_dims) { in MakeNCHWFormat() argument
27 for (int i = 0; i < num_spatial_dims; ++i) { in MakeNCHWFormat()
51 const int num_spatial_dims = spatial_dim_sizes.size(); in ExpandWithBatchAndFeatureDimensions() local
52 std::vector<int64> tensor_sizes(num_spatial_dims + 2, 1); in ExpandWithBatchAndFeatureDimensions()
53 for (int i = 0; i < num_spatial_dims; ++i) { in ExpandWithBatchAndFeatureDimensions()
Dpooling.h40 int num_spatial_dims() const { return spatial_dimensions_.size(); } in num_spatial_dims() function
/external/tensorflow/tensorflow/python/ops/
Dnn_ops.py560 def build_op(num_spatial_dims, padding): argument
561 return lambda inp, _: op(inp, num_spatial_dims, padding)
613 num_spatial_dims = dilation_rate.shape.dims[0].value
622 num_spatial_dims + starting_spatial_dim)
650 self.call = build_op(num_spatial_dims, padding)
668 const_filter_shape, num_spatial_dims, rate_or_const_rate)
670 self.num_spatial_dims = num_spatial_dims
674 self.base_paddings = np.zeros([num_spatial_dims, 2], np.int32)
677 .reshape([num_spatial_dims + 2, 2]))
690 self.op = build_op(num_spatial_dims, "VALID")
[all …]
/external/tensorflow/tensorflow/compiler/xla/service/cpu/
Dconv_canonicalization.cc46 const int64 num_spatial_dims = dnums.output_spatial_dimensions_size(); in Run() local
47 const int64 num_dims = num_spatial_dims + 2; in Run()
64 for (int64 i = 0; i < num_spatial_dims; ++i) { in Run()
83 for (int64 i = 0; i < num_spatial_dims; ++i) { in Run()
107 for (int64 i = 0; i < num_spatial_dims; ++i) { in Run()
120 for (int64 i = 0; i < num_spatial_dims; ++i) { in Run()
Dir_emission_utils.cc87 const int64 num_spatial_dims = dnums.output_spatial_dimensions_size(); in PotentiallyImplementedAsEigenConvolution() local
88 if (num_spatial_dims > 2) { in PotentiallyImplementedAsEigenConvolution()
92 for (int64 i = 0; i < num_spatial_dims; ++i) { in PotentiallyImplementedAsEigenConvolution()
/external/tensorflow/tensorflow/core/kernels/
Dconv_grad_shape_utils.cc95 StringPiece label, int num_spatial_dims, const TensorShape& input_shape, in ConvBackpropComputeDimensionsV2() argument
101 const int num_dims = num_spatial_dims + 2; in ConvBackpropComputeDimensionsV2()
139 dims->spatial_dims.resize(num_spatial_dims); in ConvBackpropComputeDimensionsV2()
140 for (int i = 0; i < num_spatial_dims; ++i) { in ConvBackpropComputeDimensionsV2()
155 Status ConvBackpropComputeDimensions(StringPiece label, int num_spatial_dims, in ConvBackpropComputeDimensions() argument
164 label, num_spatial_dims, input_shape, filter_shape, out_backprop_shape, in ConvBackpropComputeDimensions()
Dconv_grad_shape_utils.h69 Status ConvBackpropComputeDimensions(StringPiece label, int num_spatial_dims,
81 StringPiece label, int num_spatial_dims, const TensorShape& input_shape,
/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
221 …def combined_op(converted_input, num_spatial_dims, padding_arg): # pylint: disable=unused-argument argument
/external/tensorflow/tensorflow/core/framework/
Dcommon_shape_fns.cc598 constexpr int num_spatial_dims = 2; in Conv2DShapeImpl() local
599 const int rank = GetTensorDimsFromSpatialDims(num_spatial_dims, data_format); in Conv2DShapeImpl()
644 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'O')); in Conv2DShapeImpl()
646 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'H')); in Conv2DShapeImpl()
648 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'W')); in Conv2DShapeImpl()
653 GetFilterDimIndex<num_spatial_dims>(filter_format, 'I')), in Conv2DShapeImpl()
659 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'I')); in Conv2DShapeImpl()
1092 constexpr int num_spatial_dims = 2; in AvgPoolShape() local
1094 input_shape, GetTensorDimIndex<num_spatial_dims>(data_format, 'N')); in AvgPoolShape()
1096 input_shape, GetTensorDimIndex<num_spatial_dims>(data_format, 'H')); in AvgPoolShape()
[all …]
/external/tensorflow/tensorflow/compiler/mlir/xla/transforms/
Dlegalize_tf.cc1093 int64_t num_spatial_dims = spatial_dim_indices.size(); in GetConvDimensionNumbersAttr() local
1094 int64_t num_dims = num_spatial_dims + 2; in GetConvDimensionNumbersAttr()
1106 builder->getI64IntegerAttr(num_spatial_dims); in GetConvDimensionNumbersAttr()
1108 builder->getI64IntegerAttr(num_spatial_dims + 1); in GetConvDimensionNumbersAttr()
1110 GetI64ElementsAttrForSeq(0, num_spatial_dims, builder); in GetConvDimensionNumbersAttr()
1156 template <typename OpTy, int num_spatial_dims, bool depthwise_conv = false>
1192 SmallVector<int64_t, num_spatial_dims> spatial_dim_indices; in matchAndRewrite()
1193 SmallVector<int64_t, num_spatial_dims> rhs_dilations; in matchAndRewrite()
1194 SmallVector<int64_t, num_spatial_dims> window_strides; in matchAndRewrite()
1195 SmallVector<int64_t, num_spatial_dims * 2> paddings; in matchAndRewrite()
[all …]
/external/tensorflow/tensorflow/compiler/mlir/xla/experimental/conv_emitter/
Dconv_emitter.cc289 int num_spatial_dims = output_spatial_indvars.size(); in CreateNaiveMlirConv() local
290 CHECK_EQ(num_spatial_dims, filter_spatial_indvars.size()); in CreateNaiveMlirConv()
303 for (int i = 0; i < num_spatial_dims; i++) { in CreateNaiveMlirConv()
307 builder.getAffineDimExpr(2 + num_spatial_dims + i) - in CreateNaiveMlirConv()
324 /*dimCount=*/2 + num_spatial_dims * 2, in CreateNaiveMlirConv()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/transforms/
Dlegalize_hlo.cc120 const int num_spatial_dims = conv_op.dimension_numbers() in matchAndRewrite() local
123 if (!IsSamePadding(conv_op, num_spatial_dims, strides, dilation, in matchAndRewrite()
136 bool IsSamePadding(mhlo::ConvOp conv_op, int num_spatial_dims, in IsSamePadding() argument
139 for (auto i : llvm::seq<int>(0, num_spatial_dims)) { in IsSamePadding()
218 int num_spatial_dims = in IsSupportedConvOp() local
221 if (num_spatial_dims != 2) return false; in IsSupportedConvOp()
227 num_spatial_dims + 1) in IsSupportedConvOp()
239 num_spatial_dims + 1) in IsSupportedConvOp()
250 num_spatial_dims || in IsSupportedConvOp()
253 .getInt() != num_spatial_dims + 1) in IsSupportedConvOp()
/external/tensorflow/tensorflow/compiler/tests/
Dxla_ops_test.py137 num_spatial_dims = 1
144 dnums.input_spatial_dimensions.extend(range(2, 2 + num_spatial_dims))
145 dnums.kernel_spatial_dimensions.extend(range(2, 2 + num_spatial_dims))
146 dnums.output_spatial_dimensions.extend(range(2, 2 + num_spatial_dims))
/external/tensorflow/tensorflow/core/ops/
Darray_ops.cc2480 constexpr int num_spatial_dims = 2; in __anon42d741193702() local
2482 GetTensorDimsFromSpatialDims(num_spatial_dims, data_format); in __anon42d741193702()
2490 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'N')); in __anon42d741193702()
2492 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'H')); in __anon42d741193702()
2494 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'W')); in __anon42d741193702()
2496 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'C')); in __anon42d741193702()
2534 constexpr int num_spatial_dims = 2; in __anon42d741193802() local
2536 GetTensorDimsFromSpatialDims(num_spatial_dims, data_format); in __anon42d741193802()
2545 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'N')); in __anon42d741193802()
2547 c->Dim(input, GetTensorDimIndex<num_spatial_dims>(data_format, 'H')); in __anon42d741193802()
[all …]

12