/external/tensorflow/tensorflow/core/util/ |
D | tensor_format_test.cc | 115 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 …]
|
D | tensor_format.h | 144 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/ |
D | conv_op_helpers.cc | 66 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 StatusOr<ConvOpAttrs> ConvOpAttrs::Create(int num_spatial_dims, bool depthwise, in Create() argument 163 attrs.num_spatial_dims = num_spatial_dims; in Create() [all …]
|
D | depthtospace_op.cc | 70 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 …]
|
D | spacetodepth_op.cc | 70 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 …]
|
D | extract_image_patches_op.cc | 50 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_t> window_strides(num_spatial_dims); in Compile() 128 std::vector<int64_t> lhs_dilation(num_spatial_dims, 1); in Compile() 129 std::vector<int64_t> rhs_dilation(num_spatial_dims); in Compile() 130 std::vector<std::pair<int64_t, int64_t>> padding(num_spatial_dims); in Compile() 136 dims.set_kernel_input_feature_dimension(num_spatial_dims); in Compile() [all …]
|
D | conv_ops.cc | 45 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() 112 OP_REQUIRES(ctx, input_shape.rank() == attrs_.num_spatial_dims + 2, in Compile() 116 attrs_.num_spatial_dims + 2, " got ", input_shape.rank())); in Compile() 164 explicit ConvBackpropFilterOp(OpKernelConstruction* ctx, int num_spatial_dims, in ConvBackpropFilterOp() argument 168 ConvOpAttrs::Create(num_spatial_dims, depthwise, ctx); in ConvBackpropFilterOp()
|
D | image_resize_ops.cc | 95 int num_spatial_dims = in_size.size(); in ComputeResizeConvolutionParameters() local 97 dims.kernel_size.resize(num_spatial_dims); in ComputeResizeConvolutionParameters() 98 dims.stride.resize(num_spatial_dims); in ComputeResizeConvolutionParameters() 99 for (int i = 0; i < num_spatial_dims; ++i) { in ComputeResizeConvolutionParameters() 239 const int num_spatial_dims, absl::Span<const int64_t> in_size, in ResizeUsingDilationAndConvolution() argument 255 dimension_numbers.set_input_feature_dimension(num_spatial_dims + 1); in ResizeUsingDilationAndConvolution() 256 dimension_numbers.set_output_feature_dimension(num_spatial_dims + 1); in ResizeUsingDilationAndConvolution() 257 for (int i = 0; i < num_spatial_dims; ++i) { in ResizeUsingDilationAndConvolution() 262 dimension_numbers.set_kernel_input_feature_dimension(num_spatial_dims + 1); in ResizeUsingDilationAndConvolution() 263 dimension_numbers.set_kernel_output_feature_dimension(num_spatial_dims); in ResizeUsingDilationAndConvolution() [all …]
|
D | pooling_ops.cc | 48 PoolingOp(OpKernelConstruction* ctx, int num_spatial_dims, in PoolingOp() argument 51 num_spatial_dims_(num_spatial_dims), in PoolingOp() 146 int num_spatial_dims) { in XlaTensorFormat() argument 147 int num_dims = num_spatial_dims + 2; in XlaTensorFormat() 150 absl::InlinedVector<int64_t, 4> spatial_dimensions(num_spatial_dims); in XlaTensorFormat() 151 for (int spatial_dim = 0; spatial_dim < num_spatial_dims; ++spatial_dim) { in XlaTensorFormat() 162 MaxPoolOp(OpKernelConstruction* ctx, int num_spatial_dims) in MaxPoolOp() argument 163 : PoolingOp(ctx, /*num_spatial_dims=*/num_spatial_dims, in MaxPoolOp() 255 AvgPoolOp(OpKernelConstruction* ctx, int num_spatial_dims) in AvgPoolOp() argument 256 : PoolingOp(ctx, /*num_spatial_dims=*/num_spatial_dims, in AvgPoolOp() [all …]
|
D | conv_op_helpers.h | 46 static StatusOr<ConvOpAttrs> Create(int num_spatial_dims, bool depthwise, 50 int num_spatial_dims; member
|
/external/tensorflow/tensorflow/compiler/xla/client/lib/ |
D | pooling.cc | 35 const int num_spatial_dims = spatial_padding.size(); in AvgPoolDivideByCountWithGeneralPadding() local 37 std::vector<int64_t> input_dim_sizes(num_spatial_dims); in AvgPoolDivideByCountWithGeneralPadding() 38 std::vector<int64_t> window_dims(num_spatial_dims); in AvgPoolDivideByCountWithGeneralPadding() 39 std::vector<int64_t> window_ksize(num_spatial_dims); in AvgPoolDivideByCountWithGeneralPadding() 40 std::vector<int64_t> 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_t> stride, in MakeSpatialPaddingConfig() argument 94 padding_config.mutable_dimensions()->Reserve(2 + num_spatial_dims); in MakeSpatialPaddingConfig() [all …]
|
D | pooling_test.cc | 25 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_t> tensor_sizes(num_spatial_dims + 2, 1); in ExpandWithBatchAndFeatureDimensions() 53 for (int i = 0; i < num_spatial_dims; ++i) { in ExpandWithBatchAndFeatureDimensions()
|
D | pooling.h | 40 int num_spatial_dims() const { return spatial_dimensions_.size(); } in num_spatial_dims() function
|
/external/tensorflow/tensorflow/python/ops/ |
D | nn_ops.py | 713 def build_op(num_spatial_dims, padding): argument 714 return lambda inp, _: op(inp, num_spatial_dims, padding) 769 num_spatial_dims = dilation_rate.shape.dims[0].value 778 num_spatial_dims + starting_spatial_dim) 807 self.call = build_op(num_spatial_dims, padding) 827 const_filter_shape, num_spatial_dims, rate_or_const_rate) 829 self.num_spatial_dims = num_spatial_dims 833 self.base_paddings = np.zeros([num_spatial_dims, 2], np.int32) 836 .reshape([num_spatial_dims + 2, 2])) 850 self.op = build_op(num_spatial_dims, "VALID") [all …]
|
/external/tensorflow/tensorflow/compiler/xla/service/cpu/ |
D | conv_canonicalization.cc | 48 const int64_t num_spatial_dims = dnums.output_spatial_dimensions_size(); in Run() local 49 const int64_t num_dims = num_spatial_dims + 2; in Run() 66 for (int64_t i = 0; i < num_spatial_dims; ++i) { in Run() 85 for (int64_t i = 0; i < num_spatial_dims; ++i) { in Run() 109 for (int64_t i = 0; i < num_spatial_dims; ++i) { in Run() 122 for (int64_t i = 0; i < num_spatial_dims; ++i) { in Run()
|
D | ir_emission_utils.cc | 85 const int64_t num_spatial_dims = dnums.output_spatial_dimensions_size(); in PotentiallyImplementedAsEigenConvolution() local 86 if (num_spatial_dims < 1 || num_spatial_dims > 3) { in PotentiallyImplementedAsEigenConvolution() 90 for (int64_t i = 0; i < num_spatial_dims; ++i) { in PotentiallyImplementedAsEigenConvolution()
|
/external/tensorflow/tensorflow/core/kernels/ |
D | conv_grad_shape_utils.cc | 96 StringPiece label, int num_spatial_dims, const TensorShape& input_shape, in ConvBackpropComputeDimensionsV2() argument 102 const int num_dims = num_spatial_dims + 2; in ConvBackpropComputeDimensionsV2() 144 dims->spatial_dims.resize(num_spatial_dims); in ConvBackpropComputeDimensionsV2() 145 for (int i = 0; i < num_spatial_dims; ++i) { in ConvBackpropComputeDimensionsV2() 160 Status ConvBackpropComputeDimensions(StringPiece label, int num_spatial_dims, in ConvBackpropComputeDimensions() argument 169 label, num_spatial_dims, input_shape, filter_shape, out_backprop_shape, in ConvBackpropComputeDimensions()
|
D | conv_grad_shape_utils.h | 69 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/nn_ops/ |
D | atrous_convolution_test.py | 48 num_spatial_dims = len(rate) 49 spatial_shape = np.array(filters.shape[:num_spatial_dims]) 53 output[tuple(np.s_[::rate[i]] for i in range(num_spatial_dims))] = filters 217 …def combined_op(converted_input, num_spatial_dims, padding_arg): # pylint: disable=unused-argument argument
|
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/transforms/ |
D | legalize_hlo.cc | 184 auto num_spatial_dims = in IsSupportedConvOp() local 187 if (num_spatial_dims != SupportedSpatialDims) return false; in IsSupportedConvOp() 438 const int num_spatial_dims = dnums.getInputSpatialDimensions().size(); in matchAndRewrite() local 452 if (IsSamePadding(conv_op, num_spatial_dims, strides, dilation, in matchAndRewrite() 467 is_depthwise_conv, input_channels, num_spatial_dims, rewriter); in matchAndRewrite() 472 bool IsSamePadding(mhlo::ConvolutionOp conv_op, int num_spatial_dims, in IsSamePadding() argument 478 for (auto i : llvm::seq<int>(0, num_spatial_dims)) { in IsSamePadding() 517 int num_spatial_dims, RankedTensorType type, in GetReformatTypeAndPermutation() argument 520 llvm::SmallVector<int64_t, 4> permutation_array(num_spatial_dims + 2); in GetReformatTypeAndPermutation() 523 llvm::SmallVector<int64_t, 4> transposed_shape(num_spatial_dims + 2); in GetReformatTypeAndPermutation() [all …]
|
/external/tensorflow/tensorflow/compiler/mlir/xla/transforms/ |
D | legalize_tf.cc | 987 int64_t num_spatial_dims = spatial_dims.size(); in GetConvDimensionNumbersAttr() local 988 int64_t num_dims = num_spatial_dims + 2; in GetConvDimensionNumbersAttr() 995 int64_t kernel_input_feature_dim = num_spatial_dims; in GetConvDimensionNumbersAttr() 996 int64_t kernel_output_feature_dim = num_spatial_dims + 1; in GetConvDimensionNumbersAttr() 998 kernel_spatial_dimensions.resize(num_spatial_dims); in GetConvDimensionNumbersAttr() 1043 template <typename OpT, int num_spatial_dims, bool depthwise_conv = false> 1148 SmallVector<int64_t, num_spatial_dims> spatial_dim_indices; in matchAndRewriteDynamicConv() 1149 SmallVector<int64_t, num_spatial_dims> rhs_dilations; in matchAndRewriteDynamicConv() 1150 SmallVector<int64_t, num_spatial_dims> window_strides; in matchAndRewriteDynamicConv() 1151 SmallVector<Value, num_spatial_dims * 2> paddings; in matchAndRewriteDynamicConv() [all …]
|
/external/tensorflow/tensorflow/compiler/mlir/xla/experimental/conv_emitter/ |
D | conv_emitter.cc | 291 int num_spatial_dims = output_spatial_indvars.size(); in CreateNaiveMlirConv() local 292 CHECK_EQ(num_spatial_dims, filter_spatial_indvars.size()); in CreateNaiveMlirConv() 305 for (int i = 0; i < num_spatial_dims; i++) { in CreateNaiveMlirConv() 309 builder.getAffineDimExpr(2 + num_spatial_dims + i) - in CreateNaiveMlirConv() 326 /*dimCount=*/2 + num_spatial_dims * 2, in CreateNaiveMlirConv()
|
/external/tensorflow/tensorflow/core/framework/ |
D | common_shape_fns.cc | 606 constexpr int num_spatial_dims = 2; in Conv2DShapeImpl() local 607 const int rank = GetTensorDimsFromSpatialDims(num_spatial_dims, data_format); in Conv2DShapeImpl() 652 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'O')); in Conv2DShapeImpl() 654 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'H')); in Conv2DShapeImpl() 656 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'W')); in Conv2DShapeImpl() 661 GetFilterDimIndex<num_spatial_dims>(filter_format, 'I')), in Conv2DShapeImpl() 667 filter_shape, GetFilterDimIndex<num_spatial_dims>(filter_format, 'I')); in Conv2DShapeImpl() 1147 constexpr int num_spatial_dims = 2; in AvgPoolShape() local 1149 input_shape, GetTensorDimIndex<num_spatial_dims>(data_format, 'N')); in AvgPoolShape() 1151 input_shape, GetTensorDimIndex<num_spatial_dims>(data_format, 'H')); in AvgPoolShape() [all …]
|
/external/tensorflow/tensorflow/compiler/tests/ |
D | xla_ops_test.py | 137 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)) 175 num_spatial_dims = 1 182 dnums.input_spatial_dimensions.extend(range(2, 2 + num_spatial_dims)) 183 dnums.kernel_spatial_dimensions.extend(range(2, 2 + num_spatial_dims)) 184 dnums.output_spatial_dimensions.extend(range(2, 2 + num_spatial_dims))
|
/external/tensorflow/tensorflow/compiler/xla/service/ |
D | hlo_evaluator_typed_visitor.h | 918 const int64_t num_spatial_dims = dnums.output_spatial_dimensions_size(); 919 CHECK_EQ(num_spatial_dims, dnums.input_spatial_dimensions_size()); 920 CHECK_EQ(num_spatial_dims, dnums.kernel_spatial_dimensions_size()); 921 CHECK_GE(num_spatial_dims, 0); 922 CHECK_EQ(window.dimensions_size(), num_spatial_dims); 1098 const int64_t num_spatial_dims = dnums.output_spatial_dimensions_size(); 1099 CHECK_EQ(num_spatial_dims, dnums.input_spatial_dimensions_size()); 1100 CHECK_EQ(num_spatial_dims, dnums.kernel_spatial_dimensions_size()); 1101 CHECK_GE(num_spatial_dims, 0); 1102 CHECK_EQ(window.dimensions_size(), num_spatial_dims); [all …]
|