Home
last modified time | relevance | path

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

123456

/external/tensorflow/tensorflow/python/kernel_tests/
Dspacetobatch_op_test.py34 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 …]
Dpad_op_test.py34 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 …]
Dbatchtospace_op_test.py139 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/
Dspacetobatch_op_test.py30 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/
Dcxx11_tensor_padding.cpp22 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 …]
Dcxx11_tensor_ref.cpp204 array<std::pair<ptrdiff_t, ptrdiff_t>, 4> paddings; in test_nested_ops_with_ref() local
205 paddings[0] = std::make_pair(0, 0); in test_nested_ops_with_ref()
206 paddings[1] = std::make_pair(2, 1); in test_nested_ops_with_ref()
207 paddings[2] = std::make_pair(3, 4); in test_nested_ops_with_ref()
208 paddings[3] = std::make_pair(0, 0); in test_nested_ops_with_ref()
210 TensorRef<Tensor<const float, 4> > ref(m.pad(paddings)); in test_nested_ops_with_ref()
/external/tensorflow/tensorflow/core/kernels/
Dpad_op.cc85 typename TTypes<Tpadding>::ConstMatrix paddings = in1.matrix<Tpadding>(); in Compute() local
88 paddings(d, 0); // Pad before existing elements. in Compute()
89 const Tpadding after_d = paddings(d, 1); // Pad after existing elements. in Compute()
138 OperateWithVariableRank(context, fixed_dims, in0, paddings, pad_value, in Compute()
165 typename TTypes<Tpadding>::ConstMatrix paddings = in CollapseAdjacentNonPaddedDimensions() local
169 while (i < paddings.dimension(0)) { in CollapseAdjacentNonPaddedDimensions()
170 if (paddings(i, 0) != 0 || paddings(i, 1) != 0) { in CollapseAdjacentNonPaddedDimensions()
176 collapsed_paddings.push_back({paddings(i, 0), paddings(i, 1)}); in CollapseAdjacentNonPaddedDimensions()
184 while (i < paddings.dimension(0) && paddings(i, 0) == 0 && in CollapseAdjacentNonPaddedDimensions()
185 paddings(i, 1) == 0) { in CollapseAdjacentNonPaddedDimensions()
[all …]
Dspacetobatch_op.cc72 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()
Dpad_op.h34 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()
Dmirror_pad_op.h371 typename TTypes<Tpaddings>::ConstMatrix paddings, int offset,
402 if (paddings(i, 0) > 0) {
404 lhs_offsets[i] = paddings(i, 0) + offset;
405 extents[i] = paddings(i, 0);
414 if (paddings(i, 1) > 0) {
415 rhs_offsets[i] = scratch.dimension(i) - paddings(i, 1);
416 lhs_offsets[i] = rhs_offsets[i] - paddings(i, 1) - offset;
417 extents[i] = paddings(i, 1);
424 lhs_offsets[i] = paddings(i, 0);
425 rhs_offsets[i] = paddings(i, 0);
Dspacetobatch_benchmark_test.cc26 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()
Dmirror_pad_op.cc85 typename TTypes<Tpaddings>::ConstMatrix paddings = in1.matrix<Tpaddings>(); in Compute() local
87 const Tpaddings before = paddings(d, 0); // Pad before existing elements. in Compute()
88 const Tpaddings after = paddings(d, 1); // Pad after existing elements. in Compute()
126 To32Bit(in0.tensor<T, i>()), paddings, offset_); \ in Compute()
296 typename TTypes<Tpaddings>::ConstMatrix paddings = in1.matrix<Tpaddings>(); in Compute() local
298 const Tpaddings before = paddings(d, 0); // Pad before existing elements. in Compute()
299 const Tpaddings after = paddings(d, 1); // Pad after existing elements. in Compute()
337 To32Bit(in0.tensor<T, k>()), paddings, offset_, \ in Compute()
Dconv_ops_fused_image_transform.cc679 const Tensor& paddings = context->input(paddings_index); in Compute() local
684 TensorShapeUtils::IsMatrix(paddings.shape()) && in Compute()
685 paddings.dim_size(1) == 2, in Compute()
687 paddings.shape().DebugString())); in Compute()
689 (allow_legacy_scalars() && dims == 0 && paddings.dim_size(0) == 1) in Compute()
693 context, fixed_dims == paddings.dim_size(0), in Compute()
696 fixed_dims, " ", paddings.shape().DebugString(), " ", in Compute()
699 context, dims == paddings.dim_size(0), in Compute()
702 dims, " ", paddings.shape().DebugString(), " ", in Compute()
713 TTypes<int32>::ConstMatrix paddings_matrix = paddings.matrix<int32>(); in Compute()
[all …]
/external/tensorflow/tensorflow/core/api_def/base_api/
Dapi_def_MirrorPad.pbtxt10 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]
Dapi_def_Pad.pbtxt5 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]
Dapi_def_PadV2.pbtxt5 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]
Dapi_def_MirrorPadGrad.pbtxt11 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]
Dapi_def_SpaceToBatchND.pbtxt17 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/
Dspacetobatch_op.cc27 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/
Darray_grad_test.cc269 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/kernels/
Dspace_to_batch_nd.cc40 paddings = GetInput(context, node, 2); in SpaceToBatchNDContext()
45 const TfLiteTensor* paddings; member
60 const int32* paddings_data = GetTensorData<int32>(op_context->paddings); in ResizeOutputTensor()
66 TF_LITE_ENSURE_EQ(context, NumDimensions(op_context->paddings), in ResizeOutputTensor()
100 !IsConstantTensor(op_context.paddings)) { in Prepare()
123 GetTensorShape(op_context.paddings), \ in Eval()
124 GetTensorData<int32_t>(op_context.paddings), \ in Eval()
Dpad.cc39 paddings = GetInput(context, node, 1); in PadContext()
49 const int paddings_total = GetTensorShape(paddings).FlatSize(); in PadContext()
50 const int32* paddings_data = GetTensorData<int32>(paddings); in PadContext()
53 if (IsConstantTensor(paddings) && paddings_total == 8 && in PadContext()
61 const TfLiteTensor* paddings; member
73 TF_LITE_ENSURE_EQ(context, SizeOfDimension(op_context->paddings, 0), in ResizeOutputTensor()
75 TF_LITE_ENSURE_EQ(context, SizeOfDimension(op_context->paddings, 1), 2); in ResizeOutputTensor()
80 const int32* paddings_data = GetTensorData<int32>(op_context->paddings); in ResizeOutputTensor()
112 if (!IsConstantTensor(op_context.paddings)) { in Prepare()
138 const int32* paddings_data = GetTensorData<int32>(op_context.paddings); in Eval()
/external/tensorflow/tensorflow/python/ops/signal/
Dfft_ops.py84 paddings = [[0, max(fft_dim.value - input_dim.value, 0)]
87 if any(pad > 0 for _, pad in paddings):
90 return _array_ops.pad(input_tensor, outer_paddings + paddings)
104 paddings = _array_ops.concat([outer_paddings, fft_paddings], 0)
105 paddings = _array_ops.stack([_array_ops.zeros_like(paddings), paddings],
107 return _array_ops.pad(input_tensor, paddings)
Dreconstruction_ops.py106 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)
/external/tensorflow/tensorflow/lite/testing/nnapi_tflite_zip_tests/
Dtest_manifest.txt1624 DISABLED_pad/pad_constant_paddings=True,dtype=tf.int32,input_shape=[1,1,2,1],paddings=[[0,0],[0,1],…
1625 DISABLED_pad/pad_constant_paddings=True,dtype=tf.int32,input_shape=[2,1,1,1],paddings=[[0,0],[0,1],…
1626 DISABLED_pad/pad_constant_paddings=False,dtype=tf.int32,input_shape=[1,1,2,1],paddings=[[0,0],[0,1]…
1627 DISABLED_pad/pad_constant_paddings=False,dtype=tf.int32,input_shape=[2,1,1,1],paddings=[[0,0],[0,1]…
1628 DISABLED_pad/pad_constant_paddings=True,dtype=tf.int64,input_shape=[1,1,2,1],paddings=[[0,0],[0,1],…
1629 DISABLED_pad/pad_constant_paddings=True,dtype=tf.int64,input_shape=[2,1,1,1],paddings=[[0,0],[0,1],…
1630 DISABLED_pad/pad_constant_paddings=False,dtype=tf.int64,input_shape=[1,1,2,1],paddings=[[0,0],[0,1]…
1631 DISABLED_pad/pad_constant_paddings=False,dtype=tf.int64,input_shape=[2,1,1,1],paddings=[[0,0],[0,1]…
1632 pad/pad_constant_paddings=True,dtype=tf.float32,input_shape=[1,1,2,1],paddings=[[0,0],[0,1],[2,3],[…
1633 pad/pad_constant_paddings=True,dtype=tf.float32,input_shape=[2,1,1,1],paddings=[[0,0],[0,1],[2,3],[…
[all …]

123456