Home
last modified time | relevance | path

Searched refs:num_dims (Results 1 – 25 of 110) sorted by relevance

12345

/external/tensorflow/tensorflow/compiler/xla/service/cpu/
Dconv_canonicalization.cc46 const int64 num_dims = num_spatial_dims + 2; in Run() local
59 std::vector<int64> new_input_dim_order(num_dims); in Run()
60 std::vector<int64> new_input_dims(num_dims); in Run()
68 new_input_dim_order[num_dims - 1] = input_feature_dim; in Run()
69 new_input_dims[num_dims - 1] = in Run()
80 std::vector<int64> new_kernel_dim_order(num_dims); in Run()
81 std::vector<int64> new_kernel_dims(num_dims); in Run()
87 new_kernel_dim_order[num_dims - 2] = kernel_input_feature_dim; in Run()
88 new_kernel_dims[num_dims - 2] = in Run()
90 new_kernel_dim_order[num_dims - 1] = kernel_output_feature_dim; in Run()
[all …]
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
Dpooling_ops.cc51 OP_REQUIRES(ctx, ksize_int.size() == num_dims(), in PoolingOp()
54 num_dims(), " dimensions")); in PoolingOp()
56 OP_REQUIRES(ctx, stride_int.size() == num_dims(), in PoolingOp()
59 num_dims(), " dimensions")); in PoolingOp()
60 for (int i = 0; i < num_dims(); ++i) { in PoolingOp()
73 int num_dims() const { return num_spatial_dims_ + 2; } in num_dims() function in tensorflow::__anon4f3a63aa0111::PoolingOp
86 if (ksize_shape.num_elements() != num_dims()) { in GetKernelSize()
90 num_dims(), " dimensions"); in GetKernelSize()
110 if (stride_shape.num_elements() != num_dims()) { in GetStride()
114 num_dims(), " dimensions"); in GetStride()
[all …]
Dextract_image_patches_op.cc44 const int num_dims = ksizes_.size(); in Compile() local
47 ctx, num_dims >= 3, in Compile()
49 const int num_spatial_dims = num_dims - 2; in Compile()
51 OP_REQUIRES(ctx, strides_.size() == num_dims, in Compile()
54 num_dims, " dimensions")); in Compile()
55 OP_REQUIRES(ctx, dilations_.size() == num_dims, in Compile()
58 num_dims, " dimensions")); in Compile()
60 int batch_dim = GetTensorBatchDimIndex(num_dims, data_format); in Compile()
61 int feature_dim = GetTensorFeatureDimIndex(num_dims, data_format); in Compile()
77 int input_dim = GetTensorSpatialDimIndex(num_dims, data_format, i); in Compile()
[all …]
Dconv_op_helpers.cc69 int num_dims = filter_shape.dimensions_size(); in TransposeFilterForGroupConvolutionBackpropInput() local
70 CHECK_GE(num_dims, 2); // Crash OK in TransposeFilterForGroupConvolutionBackpropInput()
72 new_shape.set_dimensions(num_dims - 1, num_groups); in TransposeFilterForGroupConvolutionBackpropInput()
73 new_shape.add_dimensions(filter_shape.dimensions(num_dims - 1) / num_groups); in TransposeFilterForGroupConvolutionBackpropInput()
77 std::vector<int64> transpose_dims(num_dims + 1); in TransposeFilterForGroupConvolutionBackpropInput()
93 int num_dims = input_shape.dimensions_size(); in TransposeInputForGroupConvolutionBackpropFilter() local
100 std::vector<int64> transpose_dims(num_dims + 1); in TransposeInputForGroupConvolutionBackpropFilter()
126 const int num_dims = attrs.num_spatial_dims + 2; in CheckConvAttrs() local
127 if (attrs.strides.size() != num_dims) { in CheckConvAttrs()
129 num_dims, " dimensions"); in CheckConvAttrs()
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/
Dreduce_join_op_test.py34 def _input_array(num_dims): argument
43 formatter = "{:0%db}" % num_dims
44 strings = [formatter.format(i) for i in xrange(2**num_dims)]
45 return np.array(strings, dtype="S%d" % num_dims).reshape([2] * num_dims)
48 def _joined_array(num_dims, reduce_dim): argument
58 formatter = "{:0%db}" % (num_dims - 1)
59 result = np.zeros(shape=[2] * (num_dims - 1), dtype="S%d" % (2 * num_dims))
61 for i in xrange(2**(num_dims - 1)):
80 num_dims = 3
81 truth = ["{:03b}".format(i) for i in xrange(2**num_dims)]
[all …]
/external/tensorflow/tensorflow/core/util/
Dtensor_format.h115 inline int GetTensorSpatialDims(int num_dims, TensorFormat format) { in GetTensorSpatialDims() argument
121 return num_dims - 2; // Exclude N,C. in GetTensorSpatialDims()
126 return num_dims - 3; // Exclude N,C,VectDim. in GetTensorSpatialDims()
133 inline int GetFilterTensorSpatialDims(int num_dims, FilterTensorFormat format) { in GetFilterTensorSpatialDims() argument
135 return num_dims - 3; // Exclude O,I,InnerI. in GetFilterTensorSpatialDims()
137 return num_dims - 2; // Exclude O,I. in GetFilterTensorSpatialDims()
172 inline int GetTensorBatchDimIndex(int num_dims, TensorFormat format) { in GetTensorBatchDimIndex() argument
180 return num_dims - 2; in GetTensorBatchDimIndex()
182 return num_dims - 1; in GetTensorBatchDimIndex()
192 inline int GetTensorFeatureDimIndex(int num_dims, TensorFormat format) { in GetTensorFeatureDimIndex() argument
[all …]
Dtensor_format_test.cc175 int num_dims = GetTensorDimsFromSpatialDims(num_spatial_dims, format); in RunDimensionIndexesTest() local
177 << ", num_dims=" << num_dims; in RunDimensionIndexesTest()
178 EXPECT_EQ(GetTensorBatchDimIndex(num_dims, format), tdm.n()); in RunDimensionIndexesTest()
180 EXPECT_EQ(GetTensorFeatureDimIndex(num_dims, format), tdm.c()); in RunDimensionIndexesTest()
183 EXPECT_EQ(GetTensorSpatialDimIndex(num_dims, format, i), tdm.spatial(i)); in RunDimensionIndexesTest()
191 int num_dims = GetFilterTensorDimsFromSpatialDims(num_spatial_dims, format); in RunDimensionIndexesTest() local
193 << ", num_dims=" << num_dims; in RunDimensionIndexesTest()
194 EXPECT_EQ(GetFilterTensorOutputChannelsDimIndex(num_dims, format), fdm.o()); in RunDimensionIndexesTest()
196 EXPECT_EQ(GetFilterTensorInputChannelsDimIndex(num_dims, format), fdm.i()); in RunDimensionIndexesTest()
199 EXPECT_EQ(GetFilterTensorSpatialDimIndex(num_dims, format, i), in RunDimensionIndexesTest()
Dpadding.cc46 int num_dims, TensorFormat data_format) { in CheckValidPadding() argument
48 if (explicit_paddings.size() != 2 * num_dims) { in CheckValidPadding()
50 "explicit_paddings attribute must contain ", 2 * num_dims, in CheckValidPadding()
59 const int32 batch_index = GetTensorBatchDimIndex(num_dims, data_format); in CheckValidPadding()
60 const int32 depth_index = GetTensorFeatureDimIndex(num_dims, data_format); in CheckValidPadding()
/external/tensorflow/tensorflow/core/kernels/
Dconv_grad_shape_utils.cc100 const int num_dims = num_spatial_dims + 2; in ConvBackpropComputeDimensionsV2() local
101 if (input_shape.dims() != num_dims) { in ConvBackpropComputeDimensionsV2()
102 return errors::InvalidArgument(label, ": input must be ", num_dims, in ConvBackpropComputeDimensionsV2()
105 if (filter_shape.dims() != num_dims) { in ConvBackpropComputeDimensionsV2()
106 return errors::InvalidArgument(label, ": filter must be ", num_dims, in ConvBackpropComputeDimensionsV2()
109 if (out_backprop_shape.dims() != num_dims) { in ConvBackpropComputeDimensionsV2()
110 return errors::InvalidArgument(label, ": out_backprop must be ", num_dims, in ConvBackpropComputeDimensionsV2()
113 int batch_dim = GetTensorBatchDimIndex(num_dims, data_format); in ConvBackpropComputeDimensionsV2()
123 int feature_dim = GetTensorFeatureDimIndex(num_dims, data_format); in ConvBackpropComputeDimensionsV2()
128 << filter_shape.dim_size(num_dims - 2); in ConvBackpropComputeDimensionsV2()
[all …]
Droll_op.cc63 const int num_dims = input.dims(); in Compute() local
67 gtl::InlinedVector<int32, 4> shift_mod_sum(num_dims, 0); in Compute()
71 axis += num_dims; in Compute()
73 OP_REQUIRES(context, FastBoundsCheck(axis, num_dims), in Compute()
81 gtl::InlinedVector<int32, 4> dim_size(num_dims); in Compute()
83 gtl::InlinedVector<int32, 4> threshold(num_dims); in Compute()
87 gtl::InlinedVector<int64, 4> dim_range(num_dims); in Compute()
91 for (int i = num_dims - 1; i >= 0; i--) { in Compute()
106 functor::Roll<Device, T>()(context, num_elements, num_dims, dim_size, in Compute()
122 const int num_dims, const gtl::ArraySlice<int32>& dim_size, in DoRoll() argument
[all …]
Dclustering_ops_test.cc50 Graph* SetUpKmeansPlusPlusInitialization(int num_dims, int num_points, in SetUpKmeansPlusPlusInitialization() argument
54 Tensor points(DT_FLOAT, TensorShape({num_points, num_dims})); in SetUpKmeansPlusPlusInitialization()
73 template <int num_points, int num_to_sample, int num_dims,
77 testing::ItemsProcessed(static_cast<int64>(iters) * num_points * num_dims * in BM_KmeansPlusPlusInitialization()
81 num_dims, num_points, num_to_sample, retries_per_sample); in BM_KmeansPlusPlusInitialization()
134 template <int num_points, int num_to_sample, int num_dims>
137 testing::ItemsProcessed(static_cast<int64>(iters) * num_points * num_dims * in BM_KMC2Initialization()
175 Graph* SetUpNearestNeighbors(int num_dims, int num_points, int num_centers, in SetUpNearestNeighbors() argument
178 Tensor points(DT_FLOAT, TensorShape({num_points, num_dims})); in SetUpNearestNeighbors()
179 Tensor centers(DT_FLOAT, TensorShape({num_centers, num_dims})); in SetUpNearestNeighbors()
[all …]
Dnth_element_op.cc52 const int num_dims = input_in.dims(); in Compute() local
53 OP_REQUIRES(context, num_dims >= 1, in Compute()
58 context, input_in.dim_size(num_dims - 1) > n, in Compute()
63 n = input_in.dim_size(num_dims - 1) - n - 1; in Compute()
68 for (int i = 0; i < num_dims - 1; ++i) { in Compute()
Ddiag_op.cc49 const int num_dims = diagonal.dims(); in Compute() local
51 context, 0 != num_dims, in Compute()
54 for (int i = 0; i < num_dims; ++i) { in Compute()
57 for (int i = 0; i < num_dims; ++i) { in Compute()
79 const int num_dims = tensor.dims(); in Compute() local
80 const int out_dims = num_dims / 2; in Compute()
81 OP_REQUIRES(context, 0 == num_dims % 2, in Compute()
Droll_op_gpu.cu.cc33 __global__ void RollKernel(const int32 nthreads, const int32 num_dims, in RollKernel() argument
40 for (int i = 0; i < num_dims; i++) { in RollKernel()
57 const int num_dims, const gtl::ArraySlice<int32> dim_size, in operator ()()
81 cfg.virtual_thread_count, num_dims, input, in operator ()()
Dsparse_slice_grad_op.cc72 const int num_dims = input_indices->dim_size(1); in Compute() local
73 OP_REQUIRES(ctx, num_dims == input_start->NumElements(), in Compute()
75 "Expected input_start to be a vector of length ", num_dims, in Compute()
96 for (int d = 0; d < num_dims; ++d) { in Compute()
/external/XNNPACK/src/
Druntime.c71 runtime->ops[i].shape1.num_dims = values[node->inputs.raw[0]].shape.num_dims; in xnn_create_runtime_v2()
72 runtime->ops[i].shape2.num_dims = values[node->inputs.raw[1]].shape.num_dims; in xnn_create_runtime_v2()
73 …alues[node->inputs.raw[0]].shape.dim, values[node->inputs.raw[0]].shape.num_dims * sizeof(size_t)); in xnn_create_runtime_v2()
74 …alues[node->inputs.raw[1]].shape.dim, values[node->inputs.raw[1]].shape.num_dims * sizeof(size_t)); in xnn_create_runtime_v2()
113 …values[node->inputs.raw[0]].shape.dim[values[node->inputs.raw[0]].shape.num_dims - 1] /* channels … in xnn_create_runtime_v2()
114 …values[node->inputs.raw[0]].shape.dim[values[node->inputs.raw[0]].shape.num_dims - 1] /* input str… in xnn_create_runtime_v2()
115 …values[node->inputs.raw[0]].shape.dim[values[node->inputs.raw[0]].shape.num_dims - 1] /* output st… in xnn_create_runtime_v2()
124 for (size_t i = 0; i + 1 < values[node->inputs.raw[0]].shape.num_dims; i++) { in xnn_create_runtime_v2()
164 …values[node->inputs.raw[0]].shape.dim[values[node->inputs.raw[0]].shape.num_dims - 1] /* channels … in xnn_create_runtime_v2()
165 …values[node->inputs.raw[0]].shape.dim[values[node->inputs.raw[0]].shape.num_dims - 1] /* input str… in xnn_create_runtime_v2()
[all …]
Dtensor.c21 size_t num_dims, in xnn_define_tensor_value() argument
41 if (num_dims > XNN_MAX_TENSOR_DIMS) { in xnn_define_tensor_value()
65 value->shape.num_dims = num_dims; in xnn_define_tensor_value()
66 memcpy(value->shape.dim, dims, num_dims * sizeof(size_t)); in xnn_define_tensor_value()
96 for (size_t i = 0; i < value->shape.num_dims; i++) { in xnn_tensor_get_size()
/external/tensorflow/tensorflow/java/src/main/native/
Dtensor_jni.cc331 int num_dims = static_cast<int>(env->GetArrayLength(shape)); in Java_org_tensorflow_Tensor_allocate() local
333 if (num_dims > 0) { in Java_org_tensorflow_Tensor_allocate()
347 int64_t* dims_copy = new int64_t[num_dims]; in Java_org_tensorflow_Tensor_allocate()
348 for (int i = 0; i < num_dims; ++i) { in Java_org_tensorflow_Tensor_allocate()
352 num_dims, static_cast<size_t>(sizeInBytes)); in Java_org_tensorflow_Tensor_allocate()
391 size_t nonScalarTF_STRINGTensorSize(JNIEnv* env, jarray value, int num_dims) { in nonScalarTF_STRINGTensorSize() argument
392 if (num_dims == 0) { in nonScalarTF_STRINGTensorSize()
408 ret += nonScalarTF_STRINGTensorSize(env, elem, num_dims - 1); in nonScalarTF_STRINGTensorSize()
414 void fillNonScalarTF_STRINGTensorData(JNIEnv* env, jarray value, int num_dims, in fillNonScalarTF_STRINGTensorData() argument
417 if (num_dims == 0) { in fillNonScalarTF_STRINGTensorData()
[all …]
Dgraph_operation_jni.cc100 jsize num_dims = TF_GraphGetTensorNumDims(graph, output, status); in Java_org_tensorflow_GraphOperation_shape() local
105 if (num_dims < 0) return nullptr; in Java_org_tensorflow_GraphOperation_shape()
114 std::unique_ptr<int64_t[]> cdims(new int64_t[num_dims]); in Java_org_tensorflow_GraphOperation_shape()
115 TF_GraphGetTensorShape(graph, output, cdims.get(), static_cast<int>(num_dims), in Java_org_tensorflow_GraphOperation_shape()
123 jlongArray ret = env->NewLongArray(num_dims); in Java_org_tensorflow_GraphOperation_shape()
125 for (int i = 0; i < num_dims; ++i) { in Java_org_tensorflow_GraphOperation_shape()
/external/tensorflow/tensorflow/compiler/xla/client/lib/
Dsvd.cc113 const int64 num_dims = a_shape.rank(); in HouseRow() local
118 const int64 num_batch_dims = num_dims - 2; in HouseRow()
126 num_dims - 1); in HouseRow()
135 {num_dims - 1})); in HouseRow()
137 std::vector<int64> broadcast_dims(num_dims - 1); in HouseRow()
178 const int64 num_dims = a_shape.rank(); in HouseCol() local
183 const int64 num_batch_dims = num_dims - 2; in HouseCol()
191 num_dims - 2); in HouseCol()
200 {num_dims - 2})); in HouseCol()
202 std::vector<int64> broadcast_dims(num_dims - 1); in HouseCol()
[all …]
Dself_adjoint_eig.cc122 const int64 num_dims = w_shape.rank(); in Update() local
167 broadcast_dims.push_back(num_dims - 1); in Update()
177 {num_dims - 2})), in Update()
184 {num_dims - 2})), in Update()
198 const int64 num_dims = shape.rank(); in ComputeFrobeniusNorms() local
202 {num_dims - 2, num_dims - 1})); in ComputeFrobeniusNorms()
207 {num_dims - 2}); in ComputeFrobeniusNorms()
343 const int64 num_dims = shape.rank(); in SortByEigenvalues() local
346 std::vector<int64> broadcast_dims(num_dims - 1); in SortByEigenvalues()
348 broadcast_dims[num_dims - 2] = num_dims - 1; in SortByEigenvalues()
[all …]
Dpooling.cc159 const int num_dims = kernel_size.size(); in AvgPool() local
160 const int num_spatial_dims = num_dims - 2; in AvgPool()
200 const int num_dims = kernel_size.size(); in AvgPoolGrad() local
202 if (gradients_size.size() != num_dims) { in AvgPoolGrad()
203 return tensorflow::errors::InvalidArgument("gradients must be ", num_dims, in AvgPoolGrad()
209 if (out_backprop_xla_shape.dimensions().size() != num_dims) { in AvgPoolGrad()
211 num_dims, "-dimensional"); in AvgPoolGrad()
239 PaddingConfig padding_config = MakeNoPaddingConfig(num_dims); in AvgPoolGrad()
245 const int num_spatial_dims = num_dims - 2; in AvgPoolGrad()
271 std::vector<int64> ones(num_dims, 1LL); in AvgPoolGrad()
Dqr.cc157 const int num_dims = a_shape.rank(); in QRBlock() local
158 if (num_dims < 2) { in QRBlock()
167 const int64 num_batch_dims = num_dims - 2; in QRBlock()
185 TF_RETURN_IF_ERROR(House(Collapse(x, {num_dims - 2, num_dims - 1}), j, in QRBlock()
208 /*broadcast_dimensions=*/{num_dims - 2, num_dims - 1}) + in QRBlock()
211 std::vector<int64> dim_ids(num_dims); in QRBlock()
356 const int num_dims = a_shape.rank(); in QRDecomposition() local
357 if (num_dims < 2) { in QRDecomposition()
372 const int64 num_batch_dims = num_dims - 2; in QRDecomposition()
/external/tensorflow/tensorflow/compiler/tests/
Dtridiagonal_solve_ops_test.py54 num_dims = 11
57 num_dims)).astype(np.float32)
58 rhs_np = np.random.normal(size=(batch_size, num_dims, 1)).astype(np.float32)
62 shape=(batch_size, 3, num_dims), dtype=dtypes.float32)
64 shape=(batch_size, num_dims, 1), dtype=dtypes.float32)
76 y = np.zeros((batch_size, num_dims), dtype=np.float32)
78 for i in range(num_dims):
82 elif i == num_dims - 1:
96 num_dims = 11
100 num_dims)).astype(np.float32)
[all …]
/external/tensorflow/tensorflow/core/common_runtime/eager/
Dtensor_handle_test.cc49 int num_dims = -1; in TEST() local
50 EXPECT_TRUE(async_th->NumDims(&num_dims).ok()); in TEST()
51 EXPECT_EQ(num_dims, 2); in TEST()

12345