/external/tensorflow/tensorflow/python/kernel_tests/ |
D | spacetobatch_op_test.py | 34 def space_to_batch_direct(input_array, block_shape, paddings): argument 50 paddings = np.array(paddings).reshape((len(block_shape), 2)) 53 pad_width=([[0, 0]] + list(paddings) + [[0, 0]] * 103 def _testPad(self, inputs, paddings, block_size, outputs): argument 108 paddings, 114 paddings, 119 paddings = np.zeros((2, 2), dtype=np.int32) 120 self._testPad(inputs, paddings, block_size, outputs) 134 paddings = np.array([[1, 0], [1, 0]], dtype=np.int32) 138 self._testPad(x_np, paddings, block_size, x_out) [all …]
|
D | pad_op_test.py | 34 def _npPad(self, inp, paddings, mode, constant_values=0): argument 37 return np.pad(inp, paddings, mode=mode, constant_values=constant_values) 39 return np.pad(inp, paddings, mode=mode) 86 def _testPad(self, np_inputs, paddings, mode, constant_values): argument 87 np_val = self._npPad(np_inputs, paddings, mode=mode, 90 tf_val = array_ops.pad(np_inputs, paddings, mode=mode, 108 def _testAll(self, np_inputs, paddings, constant_values): argument 114 self._testPad(np_inputs, paddings, mode=mode, 117 self._testGradient(np_inputs, paddings, mode=mode, 205 paddings = [[1, 0], [2, 3], [0, 2]] [all …]
|
D | batchtospace_op_test.py | 139 def _testStaticShape(self, input_shape, block_shape, paddings, error): argument 141 paddings = np.array(paddings) 146 np.zeros(input_shape, np.float32), block_shape, paddings) 148 def _testDynamicShape(self, input_shape, block_shape, paddings): argument 150 paddings = np.array(paddings) 164 paddings_placeholder: paddings 167 def _testShape(self, input_shape, block_shape, paddings, error): argument 168 self._testStaticShape(input_shape, block_shape, paddings, error) 169 self._testDynamicShape(input_shape, block_shape, paddings)
|
/external/tensorflow/tensorflow/compiler/tests/ |
D | spacetobatch_op_test.py | 30 def space_to_batch_direct(input_array, block_shape, paddings): argument 46 paddings = np.array(paddings).reshape((len(block_shape), 2)) 49 pad_width=([[0, 0]] + list(paddings) + [[0, 0]] * 74 def _testPad(self, inputs, paddings, block_size, outputs): argument 80 placeholder, paddings, block_size=block_size) 84 placeholder, paddings, block_size=block_size) 88 paddings = np.zeros((2, 2), dtype=np.int32) 89 self._testPad(inputs, paddings, block_size, outputs) 101 paddings = np.array([[1, 0], [1, 0]], dtype=np.int32) 105 self._testPad(x_np, paddings, block_size, x_out) [all …]
|
/external/eigen/unsupported/test/ |
D | cxx11_tensor_padding.cpp | 22 array<std::pair<ptrdiff_t, ptrdiff_t>, 4> paddings; in test_simple_padding() local 23 paddings[0] = std::make_pair(0, 0); in test_simple_padding() 24 paddings[1] = std::make_pair(2, 1); in test_simple_padding() 25 paddings[2] = std::make_pair(3, 4); in test_simple_padding() 26 paddings[3] = std::make_pair(0, 0); in test_simple_padding() 29 padded = tensor.pad(paddings); in test_simple_padding() 57 array<std::pair<ptrdiff_t, ptrdiff_t>, 4> paddings; in test_padded_expr() local 58 paddings[0] = std::make_pair(0, 0); in test_padded_expr() 59 paddings[1] = std::make_pair(2, 1); in test_padded_expr() 60 paddings[2] = std::make_pair(3, 4); in test_padded_expr() [all …]
|
/external/tensorflow/tensorflow/core/kernels/ |
D | pad_op.cc | 82 typename TTypes<Tpadding>::ConstMatrix paddings = in1.matrix<Tpadding>(); in Compute() local 85 paddings(d, 0); // Pad before existing elements. in Compute() 86 const Tpadding after_d = paddings(d, 1); // Pad after existing elements. in Compute() 133 OperateWithVariableRank(context, dims, in0, paddings, pad_value, output); in Compute() 159 typename TTypes<Tpadding>::ConstMatrix paddings = in CollapseAdjacentNonPaddedDimensions() local 163 while (i < paddings.dimension(0)) { in CollapseAdjacentNonPaddedDimensions() 164 if (paddings(i, 0) != 0 || paddings(i, 1) != 0) { in CollapseAdjacentNonPaddedDimensions() 170 collapsed_paddings.push_back({paddings(i, 0), paddings(i, 1)}); in CollapseAdjacentNonPaddedDimensions() 178 while (i < paddings.dimension(0) && paddings(i, 0) == 0 && in CollapseAdjacentNonPaddedDimensions() 179 paddings(i, 1) == 0) { in CollapseAdjacentNonPaddedDimensions() [all …]
|
D | spacetobatch_op.cc | 72 gtl::InlinedVector<int64, 8> paddings; in SpaceToBatchOpCompute() local 74 internal::spacetobatch::SubtleMustCopyFlat(orig_paddings, &paddings); in SpaceToBatchOpCompute() 81 if (paddings[2 * dim] != 0 || paddings[2 * dim + 1] != 0 || in SpaceToBatchOpCompute() 93 if (paddings[dim * 2] != 0 || paddings[dim * 2 + 1] != 0 || in SpaceToBatchOpCompute() 148 const int64 pad_start = paddings[2 * block_dim], in SpaceToBatchOpCompute() 149 pad_end = paddings[2 * block_dim + 1]; in SpaceToBatchOpCompute() 183 const int64* internal_paddings = &paddings[2 * removed_prefix_block_dims]; in SpaceToBatchOpCompute()
|
D | pad_op.h | 34 Eigen::array<Eigen::IndexPair<Tpadding>, Dims> paddings, in operator() 38 To32Bit(output).device(d) = To32Bit(input).pad(paddings, pad_value); in operator() 40 output.device(d) = input.pad(paddings, pad_value); in operator()
|
D | spacetobatch_benchmark_test.cc | 26 DataType dtype, const std::vector<std::pair<int, int>>& paddings) { in ConstructSpaceToBatchGraph() argument 28 CHECK_EQ(num_block_dims, paddings.size()); in ConstructSpaceToBatchGraph() 33 paddings_eigen_tensor(block_dim, 0) = paddings[block_dim].first; in ConstructSpaceToBatchGraph() 34 paddings_eigen_tensor(block_dim, 1) = paddings[block_dim].second; in ConstructSpaceToBatchGraph()
|
D | mirror_pad_op.h | 377 typename TTypes<Tpaddings>::ConstMatrix paddings, int offset, 408 if (paddings(i, 0) > 0) { 410 lhs_offsets[i] = paddings(i, 0) + offset; 411 extents[i] = paddings(i, 0); 420 if (paddings(i, 1) > 0) { 421 rhs_offsets[i] = scratch.dimension(i) - paddings(i, 1); 422 lhs_offsets[i] = rhs_offsets[i] - paddings(i, 1) - offset; 423 extents[i] = paddings(i, 1); 430 lhs_offsets[i] = paddings(i, 0); 431 rhs_offsets[i] = paddings(i, 0);
|
/external/tensorflow/tensorflow/core/api_def/base_api/ |
D | api_def_MirrorPad.pbtxt | 10 name: "paddings" 27 do include the borders. For example, if `input` is `[1, 2, 3]` and `paddings` 34 This operation pads a `input` with mirrored values according to the `paddings` 35 you specify. `paddings` is an integer tensor with shape `[n, 2]`, where n is 36 the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates 38 `paddings[D, 1]` indicates how many values to add after the contents of `input` 39 in that dimension. Both `paddings[D, 0]` and `paddings[D, 1]` must be no greater 45 `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` 51 # 'paddings' is [[1, 1]], [2, 2]]. 54 pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
|
D | api_def_Pad.pbtxt | 5 This operation pads a `input` with zeros according to the `paddings` you 6 specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is the 7 rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates 9 `paddings[D, 1]` indicates how many zeros to add after the contents of `input` 14 `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` 20 # 'paddings' is [[1, 1], [2, 2]] 22 pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
|
D | api_def_PadV2.pbtxt | 5 This operation pads `input` according to the `paddings` and `constant_values` 6 you specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is 7 the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates 9 and `paddings[D, 1]` indicates how many padding values to add after the contents 15 `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` 21 # 'paddings' is [[1, 1], [2, 2]] 24 pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
|
D | api_def_MirrorPadGrad.pbtxt | 11 name: "paddings" 32 `paddings` you specify. `paddings` must be the same as `paddings` argument 37 `input.dim_size(D) - paddings(D, 0) - paddings(D, 1)` 43 # 'paddings' is [[0, 1]], [0, 1]]. 46 pad(t, paddings) ==> [[ 1, 5]
|
D | api_def_SpaceToBatchND.pbtxt | 17 name: "paddings" 20 `paddings[i] = [pad_start, pad_end]` specifies the padding for input dimension 27 input according to `paddings` to produce `padded` of shape `padded_shape`. 61 `paddings = [[0, 0], [0, 0]]`: 74 `paddings = [[0, 0], [0, 0]]`: 88 `paddings = [[0, 0], [0, 0]]`: 107 paddings = `[[0, 0], [2, 0]]`: 137 input are optionally zero padded according to `paddings`. See below for a
|
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/ |
D | spacetobatch_op.cc | 27 const xla::Literal& paddings) { in SpaceToBatch() argument 42 paddings.shape().rank() == 2 && in SpaceToBatch() 43 block_rank == xla::ShapeUtil::GetDimension(paddings.shape(), 0) && in SpaceToBatch() 44 2 == xla::ShapeUtil::GetDimension(paddings.shape(), 1), in SpaceToBatch() 47 xla::ShapeUtil::HumanString(paddings.shape()))); in SpaceToBatch() 59 int64 pad_start = paddings.Get<int64>({i, 0}); in SpaceToBatch() 60 int64 pad_end = paddings.Get<int64>({i, 1}); in SpaceToBatch() 156 xla::Literal paddings; in Compile() local 157 OP_REQUIRES_OK(ctx, ctx->ConstantInputAsInt64Literal(2, &paddings)); in Compile() 160 block_shape, paddings); in Compile() [all …]
|
/external/tensorflow/tensorflow/cc/gradients/ |
D | array_grad_test.cc | 269 auto paddings = Const(scope_, {{1, 1}, {2, 2}}); in TEST_F() local 271 auto y = Pad(scope_, x, paddings); in TEST_F() 278 auto paddings = Const(scope_, {{1, 1}, {1, 1}}); in TEST_F() local 280 auto y = SpaceToBatch(scope_, x, paddings, /* block_size */ 2); in TEST_F() 288 auto paddings = Const(scope_, {{0, 0}, {2, 0}}); in TEST_F() local 290 auto y = SpaceToBatchND(scope_, x, block_shape, paddings); in TEST_F() 297 auto paddings = Const(scope_, {{1, 1}, {1, 1}}); in TEST_F() local 299 auto y = BatchToSpace(scope_, x, paddings, /* block_size */ 2); in TEST_F() 307 auto paddings = Const(scope_, {{0, 0}, {2, 0}}); in TEST_F() local 309 auto y = BatchToSpaceND(scope_, x, block_shape, paddings); in TEST_F() [all …]
|
/external/tensorflow/tensorflow/lite/testing/op_tests/ |
D | padv2.py | 69 paddings = parameters["paddings"] 73 paddings = tf.compat.v1.placeholder( 75 input_tensors = [input_tensor, paddings] 79 paddings=paddings,
|
D | pad.py | 95 paddings = parameters["paddings"] 99 paddings = tf.compat.v1.placeholder( 101 input_tensors = [input_tensor, paddings] 103 out = tf.pad(input_tensor, paddings=paddings)
|
D | space_to_batch_nd.py | 79 paddings = parameters["paddings"] 82 paddings = tf.compat.v1.placeholder( 84 input_tensors.append(paddings) 86 out = tf.space_to_batch_nd(input_tensor, block_shape, paddings)
|
/external/tensorflow/tensorflow/lite/micro/kernels/ |
D | pad.cc | 41 paddings = GetInput(context, node, 1); in PadContext() 52 const int paddings_total = GetTensorShape(paddings).FlatSize(); in PadContext() 53 const int32* paddings_data = GetTensorData<int32>(paddings); in PadContext() 56 if (IsConstantTensor(paddings) && paddings_total == 8 && in PadContext() 64 const TfLiteTensor* paddings; member 82 TF_LITE_ENSURE_EQ(context, GetTensorShape(op_context.paddings).FlatSize(), in Prepare() 86 const int32* paddings_data = GetTensorData<int32>(op_context.paddings); in Prepare() 97 TF_LITE_ENSURE(context, IsConstantTensor(op_context.paddings)); in Prepare() 110 const int32* paddings_data = GetTensorData<int32>(op_context.paddings); in Eval()
|
/external/tensorflow/tensorflow/lite/kernels/ |
D | pad.cc | 41 paddings = GetInput(context, node, 1); in PadContext() 51 const int paddings_total = GetTensorShape(paddings).FlatSize(); in PadContext() 52 const int32* paddings_data = GetTensorData<int32>(paddings); in PadContext() 55 if (IsConstantTensor(paddings) && paddings_total == 8 && in PadContext() 63 const TfLiteTensor* paddings; member 75 TF_LITE_ENSURE_EQ(context, SizeOfDimension(op_context->paddings, 0), in ResizeOutputTensor() 77 TF_LITE_ENSURE_EQ(context, SizeOfDimension(op_context->paddings, 1), 2); in ResizeOutputTensor() 82 const int32* paddings_data = GetTensorData<int32>(op_context->paddings); in ResizeOutputTensor() 115 if (!IsConstantTensor(op_context.paddings)) { in Prepare() 137 const int32* paddings_data = GetTensorData<int32>(op_context.paddings); in Eval()
|
D | space_to_batch_nd.cc | 42 paddings = GetInput(context, node, 2); in SpaceToBatchNDContext() 47 const TfLiteTensor* paddings; member 62 const int32* paddings_data = GetTensorData<int32>(op_context->paddings); in ResizeOutputTensor() 68 TF_LITE_ENSURE_EQ(context, NumDimensions(op_context->paddings), in ResizeOutputTensor() 102 !IsConstantTensor(op_context.paddings)) { in Prepare() 125 GetTensorShape(op_context.paddings), \ in Eval() 126 GetTensorData<int32_t>(op_context.paddings), \ in Eval()
|
/external/tensorflow/tensorflow/lite/experimental/delegates/hexagon/builders/tests/ |
D | pad_test.cc | 25 std::initializer_list<int> paddings, in PadOpConstModel() argument 28 paddings_ = AddConstInput(TensorType_INT32, paddings, paddings_shape); in PadOpConstModel() 40 void SetPaddings(std::initializer_list<int> paddings) { in SetPaddings() argument 41 PopulateTensor<int>(paddings_, paddings); in SetPaddings()
|
/external/tensorflow/tensorflow/python/ops/signal/ |
D | reconstruction_ops.py | 106 paddings = [[0, segments], [0, segments * frame_step - frame_length]] 108 paddings = array_ops.concat([outer_paddings, paddings], 0) 109 signal = array_ops.pad(signal, paddings)
|