Home
last modified time | relevance | path

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

123

/external/tensorflow/tensorflow/compiler/tests/
Dspacetobatch_op_test.py30 def space_to_batch_direct(input_array, block_shape, paddings): argument
44 block_shape = np.array(block_shape)
45 num_block_dims = len(block_shape)
46 paddings = np.array(paddings).reshape((len(block_shape), 2))
53 output_shape = [input_array.shape[0] * np.prod(block_shape)]
54 for block_dim, block_shape_value in enumerate(block_shape):
155 def _testPad(self, inputs, block_shape, paddings, outputs): argument
156 block_shape = np.array(block_shape)
157 paddings = np.array(paddings).reshape((len(block_shape), 2))
176 x_tf = array_ops.space_to_batch_nd(placeholder, block_shape,
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/
Dspacetobatch_op_test.py34 def space_to_batch_direct(input_array, block_shape, paddings): argument
48 block_shape = np.array(block_shape)
49 num_block_dims = len(block_shape)
50 paddings = np.array(paddings).reshape((len(block_shape), 2))
57 output_shape = [input_array.shape[0] * np.prod(block_shape)]
58 for block_dim, block_shape_value in enumerate(block_shape):
200 def _testPad(self, inputs, block_shape, paddings, outputs): argument
201 block_shape = np.array(block_shape)
202 paddings = np.array(paddings).reshape((len(block_shape), 2))
207 math_ops.cast(inputs, dtypes.float32), block_shape, paddings)
[all …]
Dbatchtospace_op_test.py139 def _testStaticShape(self, input_shape, block_shape, paddings, error): argument
140 block_shape = np.array(block_shape)
146 np.zeros(input_shape, np.float32), block_shape, paddings)
148 def _testDynamicShape(self, input_shape, block_shape, paddings): argument
149 block_shape = np.array(block_shape)
155 dtypes.int32, shape=block_shape.shape)
163 block_shape_placeholder: block_shape,
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)
[all …]
/external/tensorflow/tensorflow/core/api_def/base_api/
Dapi_def_BatchToSpaceND.pbtxt11 name: "block_shape"
23 `crop_start[i] + crop_end[i] <= block_shape[i] * input_shape[i + 1]`.
28 [block_shape[0], ..., block_shape[M-1],
29 batch / prod(block_shape),
33 [batch / prod(block_shape),
35 input_shape[1], block_shape[0],
37 input_shape[M], block_shape[M-1],
42 [batch / prod(block_shape),
44 input_shape[1] * block_shape[0],
46 input_shape[M] * block_shape[M-1],
[all …]
Dapi_def_SpaceToBatchND.pbtxt11 name: "block_shape"
22 `block_shape[i]` divides `input_shape[i + 1] + pad_start + pad_end`.
32 [padded_shape[1] / block_shape[0],
33 block_shape[0],
35 padded_shape[M] / block_shape[M-1],
36 block_shape[M-1]] +
42 block_shape +
44 [padded_shape[1] / block_shape[0],
46 padded_shape[M] / block_shape[M-1]] +
49 4. Reshape `permuted_reshaped_padded` to flatten `block_shape` into the batch
[all …]
/external/tensorflow/tensorflow/lite/kernels/
Dbatch_to_space_nd.cc39 block_shape = GetInput(context, node, 1); in BatchToSpaceNDContext()
44 const TfLiteTensor* block_shape; member
59 const int* block_shape = GetTensorData<int32>(op_context->block_shape); in ResizeOutputTensor() local
64 TF_LITE_ENSURE_EQ(context, NumDimensions(op_context->block_shape), 1); in ResizeOutputTensor()
65 TF_LITE_ENSURE_EQ(context, op_context->block_shape->dims->data[0], in ResizeOutputTensor()
81 TF_LITE_ENSURE_EQ(context, output_batch_size % block_shape[dim], 0); in ResizeOutputTensor()
82 output_batch_size = output_batch_size / block_shape[dim]; in ResizeOutputTensor()
83 output_size->data[dim + 1] = input_size->data[dim + 1] * block_shape[dim] - in ResizeOutputTensor()
105 if (!IsConstantTensor(op_context.block_shape) || in Prepare()
125 GetTensorShape(op_context.block_shape), \ in Eval()
[all …]
Dspace_to_batch_nd.cc40 block_shape = GetInput(context, node, 1); in SpaceToBatchNDContext()
45 const TfLiteTensor* block_shape; member
60 const int32* block_shape = GetTensorData<int32>(op_context->block_shape); in ResizeOutputTensor() local
65 TF_LITE_ENSURE_EQ(context, NumDimensions(op_context->block_shape), 1); in ResizeOutputTensor()
66 TF_LITE_ENSURE_EQ(context, op_context->block_shape->dims->data[0], in ResizeOutputTensor()
82 TF_LITE_ENSURE_EQ(context, final_dim_size % block_shape[dim], 0); in ResizeOutputTensor()
83 output_size->data[dim + 1] = final_dim_size / block_shape[dim]; in ResizeOutputTensor()
84 output_batch_size *= block_shape[dim]; in ResizeOutputTensor()
106 if (!IsConstantTensor(op_context.block_shape) || in Prepare()
128 GetTensorShape(op_context.block_shape), \ in Eval()
[all …]
Dbatch_to_space_nd_test.cc71 std::initializer_list<int> block_shape, in BatchToSpaceNDOpConstModel() argument
74 int spatial_dims = static_cast<int>(block_shape.size()); in BatchToSpaceNDOpConstModel()
76 block_shape_ = AddConstInput(TensorType_INT32, block_shape, {spatial_dims}); in BatchToSpaceNDOpConstModel()
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
Dspacetobatch_op.cc26 absl::Span<const int64> block_shape, in SpaceToBatch() argument
31 const int block_rank = block_shape.size(); in SpaceToBatch()
66 block_num_elems *= block_shape[i]; in SpaceToBatch()
92 OP_REQUIRES(ctx, padded_shape[1 + i] % block_shape[i] == 0, in SpaceToBatch()
96 "]=", block_shape[i])); in SpaceToBatch()
98 reshaped_padded_shape[1 + i * 2] = padded_shape[1 + i] / block_shape[i]; in SpaceToBatch()
99 reshaped_padded_shape[1 + i * 2 + 1] = block_shape[i]; in SpaceToBatch()
139 output_shape[1 + i] = padded_shape[1 + i] / block_shape[i]; in SpaceToBatch()
153 std::vector<int64> block_shape; in Compile() local
154 OP_REQUIRES_OK(ctx, ctx->ConstantInputAsIntVector(1, &block_shape)); in Compile()
[all …]
Dbatchtospace_op.cc26 absl::Span<const int64> block_shape, in BatchToSpace() argument
31 const int block_rank = block_shape.size(); in BatchToSpace()
54 block_num_elems *= block_shape[i]; in BatchToSpace()
71 std::copy(block_shape.begin(), block_shape.end(), reshaped_shape.begin()); in BatchToSpace()
108 reshaped_permuted_shape[1 + i] = block_shape[i] * input_shape[1 + i]; in BatchToSpace()
151 std::vector<int64> block_shape; in Compile() local
152 OP_REQUIRES_OK(ctx, ctx->ConstantInputAsIntVector(1, &block_shape)); in Compile()
158 block_shape, crops); in Compile()
/external/tensorflow/tensorflow/core/kernels/
Dspacetobatch_functor.cc40 const int64* space_tensor_strides, const int64* block_shape, in run()
47 batch_tensor_pos * block_shape[0] + block_offsets[0] - pad_start[0]; in run()
51 space_tensor_shape + 1, space_tensor_strides + 1, block_shape + 1, in run()
71 const int64* space_tensor_strides, const int64* block_shape, in run()
104 int64 block_shape[NUM_BLOCK_DIMS]; in operator ()() local
109 block_shape[block_dim] = block_shape_tensor[block_dim]; in operator ()()
138 block_dim > 0 ? block_index % block_shape[block_dim] : block_index; in operator ()()
139 block_index /= block_shape[block_dim]; in operator ()()
145 space_tensor_shape, &space_tensor_strides[1], block_shape, pad_start, in operator ()()
Dspacetobatch_functor_gpu.cu.cc38 int32 block_shape[NUM_BLOCK_DIMS]; member
70 offset %= args.block_shape[block_dim]; in S2B()
73 batch_tensor_pos[block_dim + 1] * args.block_shape[block_dim] + in S2B()
95 remaining_block_idx /= args.block_shape[block_dim]; in S2B()
108 const int64 block_shape[NUM_BLOCK_DIMS], in operator ()()
118 if (block_shape[block_dim] > std::numeric_limits<int32>::max()) { in operator ()()
121 args.block_shape[block_dim] = block_shape[block_dim]; in operator ()()
Dspacetobatch_op.cc71 gtl::InlinedVector<int64, 4> block_shape; in SpaceToBatchOpCompute() local
73 internal::spacetobatch::SubtleMustCopyFlat(orig_block_shape, &block_shape); in SpaceToBatchOpCompute()
82 block_shape[dim] != 1) { in SpaceToBatchOpCompute()
94 block_shape[dim] != 1) { in SpaceToBatchOpCompute()
102 block_shape_product *= block_shape[block_dim]; in SpaceToBatchOpCompute()
154 const int64 block_shape_value = block_shape[block_dim]; in SpaceToBatchOpCompute()
184 const int64* internal_block_shape = &block_shape[removed_prefix_block_dims]; in SpaceToBatchOpCompute()
Dbatchtospace_op.cc68 gtl::InlinedVector<int64, 4> block_shape; in BatchToSpaceOpCompute() local
70 internal::spacetobatch::SubtleMustCopyFlat(orig_block_shape, &block_shape); in BatchToSpaceOpCompute()
79 block_shape[dim] != 1) { in BatchToSpaceOpCompute()
91 block_shape[dim] != 1) { in BatchToSpaceOpCompute()
99 block_shape_product *= block_shape[block_dim]; in BatchToSpaceOpCompute()
155 const int64 block_shape_value = block_shape[block_dim]; in BatchToSpaceOpCompute()
182 const int64* internal_block_shape = &block_shape[removed_prefix_block_dims]; in BatchToSpaceOpCompute()
/external/tensorflow/tensorflow/lite/micro/kernels/
Dbatch_to_space_nd.cc64 const TfLiteEvalTensor* block_shape = in Eval() local
76 tflite::micro::GetTensorShape(block_shape), in Eval()
77 tflite::micro::GetTensorData<int32_t>(block_shape), in Eval()
87 tflite::micro::GetTensorShape(block_shape), in Eval()
88 tflite::micro::GetTensorData<int32_t>(block_shape), in Eval()
Dspace_to_batch_nd.cc74 const TfLiteEvalTensor* block_shape = in Eval() local
86 tflite::micro::GetTensorShape(block_shape), in Eval()
87 tflite::micro::GetTensorData<int32_t>(block_shape), in Eval()
97 tflite::micro::GetTensorShape(block_shape), in Eval()
98 tflite::micro::GetTensorData<int32_t>(block_shape), in Eval()
/external/tensorflow/tensorflow/lite/testing/op_tests/
Dbatch_to_space_nd.py85 block_shape = parameters["block_shape"]
88 block_shape = tf.compat.v1.placeholder(
90 input_tensors.append(block_shape)
101 out = tf.batch_to_space_nd(input_tensor, block_shape, crops)
Dspace_to_batch_nd.py79 block_shape = parameters["block_shape"]
82 block_shape = tf.compat.v1.placeholder(
84 input_tensors.append(block_shape)
95 out = tf.space_to_batch_nd(input_tensor, block_shape, paddings)
/external/tensorflow/tensorflow/core/ops/
Darray_ops_test.cc1425 Tensor block_shape = test::AsTensor<int32>({2, 3}); in TEST() local
1426 op.input_tensors[1] = &block_shape; in TEST()
1452 Tensor block_shape = test::AsTensor<int32>({0, 2}); in TEST() local
1453 op.input_tensors[1] = &block_shape; in TEST()
1459 Tensor block_shape = test::AsTensor<int32>({1, 1}); in TEST() local
1460 op.input_tensors[1] = &block_shape; in TEST()
1469 Tensor block_shape = test::AsTensor<int32>({3, 3}); in TEST() local
1470 op.input_tensors[1] = &block_shape; in TEST()
1479 Tensor block_shape = test::AsTensor<int32>({}); in TEST() local
1480 op.input_tensors[1] = &block_shape; in TEST()
[all …]
/external/tensorflow/tensorflow/tools/graph_transforms/
Dflatten_atrous.cc62 Tensor block_shape = in FlattenAtrousConv() local
64 const int32 block_height = block_shape.flat<int32>()(0); in FlattenAtrousConv()
65 const int32 block_width = block_shape.flat<int32>()(1); in FlattenAtrousConv()
/external/tensorflow/tensorflow/tools/api/golden/v1/
Dtensorflow.manip.pbtxt5 …argspec: "args=[\'input\', \'block_shape\', \'crops\', \'name\'], varargs=None, keywords=None, def…
29 …argspec: "args=[\'input\', \'block_shape\', \'paddings\', \'name\'], varargs=None, keywords=None, …
/external/tensorflow/tensorflow/lite/toco/graph_transformations/
Dresolve_batch_to_space_nd_attributes.cc39 if (!op->block_shape.empty()) { in Run()
72 op->block_shape.push_back(block_shape_buffer[i]); in Run()
Dresolve_space_to_batch_nd_attributes.cc39 if (!op->block_shape.empty()) { in Run()
76 op->block_shape.push_back(block_shape_buffer[i]); in Run()
/external/tensorflow/tensorflow/python/ops/
Darray_ops.py3872 block_shape, argument
3904 [input_shape, block_shape]):
3907 block_shape = ops.convert_to_tensor(
3908 block_shape, dtype=dtypes.int32, name="block_shape")
3910 block_shape.get_shape().assert_is_fully_defined()
3911 block_shape.get_shape().assert_has_rank(1)
3912 num_block_dims = block_shape.get_shape().dims[0].value
3925 const_block_shape = tensor_util.constant_value(block_shape)
3930 block_shape = const_block_shape
3938 pad_end_extra = (block_shape - full_input_shape % block_shape) % block_shape
[all …]
/external/tensorflow/tensorflow/python/ops/linalg/
Dlinear_operator_circulant.py183 if self.block_shape.is_fully_defined():
185 self.block_shape.as_list(), name="block_shape")
192 def block_shape(self): member in _BaseLinearOperatorCirculant
218 self.block_shape.is_fully_defined()):
222 final_shape = vec_leading_shape.concatenate(self.block_shape)

123