/external/tensorflow/tensorflow/compiler/tests/ |
spacetobatch_op_test.py | 29 def space_to_batch_direct(input_array, block_shape, paddings): 36 block_shape: 1-D array of shape [num_block_dims]. 43 block_shape = np.array(block_shape) 44 num_block_dims = len(block_shape) 45 paddings = np.array(paddings).reshape((len(block_shape), 2)) 52 output_shape = [input_array.shape[0] * np.prod(block_shape)] 53 for block_dim, block_shape_value in enumerate(block_shape): 154 def _testPad(self, inputs, block_shape, paddings, outputs): 155 block_shape = np.array(block_shape [all...] |
/external/tensorflow/tensorflow/contrib/lite/kernels/ |
batch_to_space_nd.cc | 39 block_shape = GetInput(context, node, 1); 44 TfLiteTensor* block_shape; member in struct:tflite::ops::builtin::batch_to_space_nd::BatchToSpaceNDContext 59 const int* block_shape = GetTensorData<int32>(op_context->block_shape); local 62 TF_LITE_ENSURE_EQ(context, NumDimensions(op_context->block_shape), 64 TF_LITE_ENSURE_EQ(context, op_context->block_shape->dims->data[0], 76 // Number of batch must be multiple of (block_shape[0] * block_shape[1]). 78 input_size->data[0] % (block_shape[0] * block_shape[1]), 0) [all...] |
space_to_batch_nd.cc | 39 block_shape = GetInput(context, node, 1); 44 TfLiteTensor* block_shape; member in struct:tflite::ops::builtin::space_to_batch_nd::SpaceToBatchNDContext 59 const int32* block_shape = GetTensorData<int32>(op_context->block_shape); local 62 TF_LITE_ENSURE_EQ(context, NumDimensions(op_context->block_shape), 64 TF_LITE_ENSURE_EQ(context, op_context->block_shape->dims->data[0], 76 TF_LITE_ENSURE_EQ(context, final_dim_size % block_shape[dim], 0); 77 output_size->data[dim + 1] = final_dim_size / block_shape[dim]; 81 input_size->data[0] * block_shape[0] * block_shape[1] [all...] |
batch_to_space_nd_test.cc | 51 // Tests case where block_shape and crops are const tensors. 54 // BatchToSpaceNDOpConstModel m(input_shape, block_shape, crops); 60 std::initializer_list<int> block_shape, 63 block_shape_ = AddConstInput(TensorType_INT32, block_shape, {2}); 74 // Tests case where block_shape and crops are non-const tensors. 79 // m.SetBlockShape(block_shape);
|
space_to_batch_nd_test.cc | 51 // Tests case where block_shape and paddings are const tensors. 54 // SpaceToBatchNDOpConstModel m(input_shape, block_shape, paddings); 60 std::initializer_list<int> block_shape, 63 block_shape_ = AddConstInput(TensorType_INT32, block_shape, {2}); 74 // Tests case where block_shape and paddings are non-const tensors. 79 // m.SetBlockShape(block_shape);
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
spacetobatch_op_test.py | 33 def space_to_batch_direct(input_array, block_shape, paddings): 40 block_shape: 1-D array of shape [num_block_dims]. 47 block_shape = np.array(block_shape) 48 num_block_dims = len(block_shape) 49 paddings = np.array(paddings).reshape((len(block_shape), 2)) 56 output_shape = [input_array.shape[0] * np.prod(block_shape)] 57 for block_dim, block_shape_value in enumerate(block_shape): 189 def _testPad(self, inputs, block_shape, paddings, outputs): 190 block_shape = np.array(block_shape [all...] |
batchtospace_op_test.py | 131 def _testStaticShape(self, input_shape, block_shape, paddings, error): 132 block_shape = np.array(block_shape) 138 np.zeros(input_shape, np.float32), block_shape, paddings) 140 def _testDynamicShape(self, input_shape, block_shape, paddings): 141 block_shape = np.array(block_shape) 147 dtypes.int32, shape=block_shape.shape) 155 block_shape_placeholder: block_shape, 159 def _testShape(self, input_shape, block_shape, paddings, error) [all...] |
/external/tensorflow/tensorflow/core/kernels/ |
spacetobatch_functor.cc | 40 const int64* space_tensor_strides, const int64* block_shape, 47 batch_tensor_pos * block_shape[0] + block_offsets[0] - pad_start[0]; 51 space_tensor_shape + 1, space_tensor_strides + 1, block_shape + 1, 71 const int64* space_tensor_strides, const int64* block_shape, 104 int64 block_shape[NUM_BLOCK_DIMS]; local 109 block_shape[block_dim] = block_shape_tensor[block_dim]; 138 block_dim > 0 ? block_index % block_shape[block_dim] : block_index; 139 block_index /= block_shape[block_dim]; 145 space_tensor_shape, &space_tensor_strides[1], block_shape, pad_start,
|
spacetobatch_functor_gpu.cu.cc | 39 int32 block_shape[NUM_BLOCK_DIMS]; member in struct:tensorflow::S2BParameters 70 offset %= args.block_shape[block_dim]; 73 batch_tensor_pos[block_dim + 1] * args.block_shape[block_dim] + 95 remaining_block_idx /= args.block_shape[block_dim]; 108 const int64 block_shape[NUM_BLOCK_DIMS], 118 if (block_shape[block_dim] > std::numeric_limits<int32>::max()) { 119 return errors::InvalidArgument("block_shape value exceeds 2^32-1"); 121 args.block_shape[block_dim] = block_shape[block_dim];
|
batchtospace_op.cc | 50 errors::InvalidArgument("block_shape rank should be 1 instead of ", 66 // To avoid out-of-bounds access in the case that the block_shape and/or 68 gtl::InlinedVector<int64, 4> block_shape; local 70 internal::spacetobatch::SubtleMustCopyFlat(orig_block_shape, &block_shape); 74 // into the batch dimension due to having no padding and block_shape=1. 79 block_shape[dim] != 1) { 85 // into the depth dimension due to having no padding and block_shape=1. 91 block_shape[dim] != 1) { 96 // Compute the product of the block_shape values. 99 block_shape_product *= block_shape[block_dim] [all...] |
spacetobatch_op.cc | 52 errors::InvalidArgument("block_shape rank should be 1 instead of ", 69 // To avoid out-of-bounds access in the case that the block_shape and/or 71 gtl::InlinedVector<int64, 4> block_shape; local 73 internal::spacetobatch::SubtleMustCopyFlat(orig_block_shape, &block_shape); 77 // into the batch dimension due to having no padding and block_shape=1. 82 block_shape[dim] != 1) { 88 // into the depth dimension due to having no padding and block_shape=1. 94 block_shape[dim] != 1) { 99 // Compute the product of the block_shape values. 102 block_shape_product *= block_shape[block_dim] [all...] |
spacetobatch_functor.h | 106 const int64 block_shape[NUM_BLOCK_DIMS],
|
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/ |
spacetobatch_op.cc | 26 gtl::ArraySlice<int64> block_shape, 31 const int block_rank = block_shape.size(); 66 block_num_elems *= block_shape[i]; 82 // [padded_shape[1] / block_shape[0], 83 // block_shape[0], 85 // padded_shape[M] / block_shape[M-1], 86 // block_shape[M-1]] + 92 OP_REQUIRES(ctx, padded_shape[1 + i] % block_shape[i] == 0, 95 " is not divisible by block_shape[", i, 96 "]=", block_shape[i])) 155 std::vector<int64> block_shape; variable [all...] |
batchtospace_op.cc | 26 gtl::ArraySlice<int64> block_shape, 31 const int block_rank = block_shape.size(); 52 // Compute the product of the block_shape values. 55 block_num_elems *= block_shape[i]; 62 // [block_shape[0], ..., block_shape[M-1], 63 // batch / prod(block_shape), 72 std::copy(block_shape.begin(), block_shape.end(), reshaped_shape.begin()); 79 // [batch / prod(block_shape), 152 std::vector<int64> block_shape; variable [all...] |
/external/tensorflow/tensorflow/contrib/lite/toco/graph_transformations/ |
resolve_batch_to_space_nd_attributes.cc | 33 // The attributes are resolved only when the 3 attributes (block_shape, 35 if (!op->block_shape.empty()) { 60 // Handle block_shape 68 op->block_shape.push_back(block_shape_buffer[i]);
|
resolve_space_to_batch_nd_attributes.cc | 33 // The attributes are resolved only when the 3 attributes (block_shape, 35 if (!op->block_shape.empty()) { 63 // Handle block_shape. 72 op->block_shape.push_back(block_shape_buffer[i]);
|
/external/tensorflow/tensorflow/tools/graph_transforms/ |
flatten_atrous.cc | 40 {"*"}, // block_shape 47 {"*"}, // block_shape 63 Tensor block_shape = 65 const int32 block_height = block_shape.flat<int32>()(0); 66 const int32 block_width = block_shape.flat<int32>()(1);
|
/external/tensorflow/tensorflow/core/ops/ |
array_ops_test.cc | 1327 Tensor block_shape = test::AsTensor<int32>({2, 3}); local 1354 Tensor block_shape = test::AsTensor<int32>({0, 2}); local 1361 Tensor block_shape = test::AsTensor<int32>({1, 1}); local 1371 Tensor block_shape = test::AsTensor<int32>({3, 3}); local 1444 Tensor block_shape = test::AsTensor<int32>({2, 3}); local 1475 Tensor block_shape = test::AsTensor<int32>({0, 2}); local 1482 Tensor block_shape = test::AsTensor<int32>({1, 1}); local 1493 Tensor block_shape = test::AsTensor<int32>({2, 2}); local 1504 Tensor block_shape = test::AsTensor<int32>({2, 3}); local [all...] |
array_ops.cc | [all...] |
/external/tensorflow/tensorflow/python/ops/ |
array_ops.py | [all...] |
nn_ops.py | 497 block_shape=self.dilation_rate) 504 input=inp, block_shape=dilation_rate, paddings=paddings) 509 input=result, block_shape=dilation_rate, crops=crops) [all...] |
/external/tensorflow/tensorflow/cc/gradients/ |
array_grad_test.cc | 279 auto block_shape = Const(scope_, {2, 2}); local 282 auto y = SpaceToBatchND(scope_, x, block_shape, paddings); 298 auto block_shape = Const(scope_, {2, 2}); local 301 auto y = BatchToSpaceND(scope_, x, block_shape, paddings);
|
/external/tensorflow/tensorflow/contrib/lite/testing/ |
generate_examples.py | [all...] |
/external/tensorflow/tensorflow/contrib/lite/toco/ |
model.h | 1356 std::vector<int> block_shape; member in struct:toco::SpaceToBatchNDOperator 1374 std::vector<int> block_shape; member in struct:toco::BatchToSpaceNDOperator [all...] |