Searched refs:ndims (Results 1 - 25 of 210) sorted by relevance

123456789

/external/tensorflow/tensorflow/contrib/distributions/python/ops/bijectors/
H A Dsoftmax_centered.py89 if input_shape.ndims is None:
91 if input_shape.ndims != self._static_event_ndims:
93 (input_shape.ndims, self._static_event_ndims))
94 if input_shape.ndims == 0:
96 if input_shape.ndims == 1:
99 raise ValueError("event_ndims = %d must be 0 or 1" % input_shape.ndims)
102 ndims = array_ops.shape(input_shape)
106 ndims, 0 if self._static_event_ndims == 0 else 1,
108 ndims = control_flow_ops.with_dependencies([is_zero_or_one], ndims)
[all...]
H A Dreshape.py143 ndims = array_ops.rank(shape)
144 ndims_ = tensor_util.constant_value(ndims)
150 ndims, 1, message="`{}` rank should be <= 1.".format(shape.op.name)))
184 x_ndims_, x_ndims = x.shape.ndims, array_ops.rank(x)
219 # have known ndims. We can assume that shape Tensors always have
220 # ndims==1 (this assumption is verified inside of
239 ndims = (x.shape.ndims if x.shape.ndims is not None
242 :(ndims
[all...]
/external/tensorflow/tensorflow/core/kernels/
H A Dtile_functor_gpu.cu.cc32 const int32 ndims, T* dst) {
34 const int32* out_strides = buf + ndims;
35 const int32* in_dim_sizes = buf + ndims * 2;
39 for (int i = 0; i < ndims; ++i) {
55 const int32 ndims = in.dims(); local
56 gtl::InlinedVector<int32, 24> host_buf(ndims * 3);
59 for (int i = 0; i < ndims; ++i) {
61 host_buf[ndims + i] = out_strides[i];
62 host_buf[ndims * 2 + i] = in.dim_size(i);
77 ndims,
31 TileKernel(int nthreads, const T* src, const int32* buf, const int32 ndims, T* dst) argument
[all...]
H A Dops_util.h91 const int ndims = shape.dims(); local
92 gtl::InlinedVector<T, 8> strides(ndims);
94 for (int i = ndims - 1; i >= 0; --i) {
104 const int ndims = shape.rank(); local
105 gtl::InlinedVector<T, 8> strides(ndims);
107 for (int i = ndims - 1; i >= 0; --i) {
H A Dcholesky_op.cc102 const int ndims = input.dims(); variable
103 const int64 n = input.dim_size(ndims - 1);
106 context, ndims >= 2,
107 errors::InvalidArgument("Input must have rank >= 2, got ", ndims),
110 context, input.dim_size(ndims - 2) == n,
112 input.dim_size(ndims - 2), " != ", n),
H A Dself_adjoint_eig_v2_op_gpu.cc50 const int ndims = input.dims(); variable
52 context, ndims >= 2,
53 errors::InvalidArgument("Input must have rank >= 2, got ", ndims),
55 const int64 n = input.dim_size(ndims - 1);
57 context, input.dim_size(ndims - 2) == n,
59 input.dim_size(ndims - 2), " != ", n),
H A Dmatrix_solve_op.cc131 const int ndims = input.dims(); variable
132 const int64 n = input.dim_size(ndims - 1);
133 const int64 nrhs = rhs.dim_size(ndims - 1);
136 context, ndims >= 2,
137 errors::InvalidArgument("Input must have rank >= 2, got ", ndims),
139 OP_REQUIRES_ASYNC(context, rhs.dims() == ndims,
142 ndims, " != ", rhs.dims()),
145 context, input.dim_size(ndims - 2) == n,
147 input.dim_size(ndims - 2), " != ", n),
149 OP_REQUIRES_ASYNC(context, rhs.dim_size(ndims
[all...]
H A Dqr_op_impl.h138 const int ndims = input.dims(); variable
139 const int64 m = input.dim_size(ndims - 2);
140 const int64 n = input.dim_size(ndims - 1);
147 context, ndims >= 2,
148 errors::InvalidArgument("Input must have rank >= 2, got ", ndims),
156 q_shape.set_dim(ndims - 1, full_matrices_ ? m : min_size);
161 r_shape.set_dim(ndims - 2, full_matrices_ ? m : min_size);
176 transposed_shape.set_dim(ndims - 2, input.dim_size(ndims - 1));
177 transposed_shape.set_dim(ndims
[all...]
H A Ddeterminant_op.cc135 const int ndims = input.dims(); variable
136 const int64 n = input.dim_size(ndims - 1);
139 context, ndims >= 2,
140 errors::InvalidArgument("Input must have rank >= 2, got ", ndims),
143 context, input.dim_size(ndims - 2) == n,
145 input.dim_size(ndims - 2), " != ", n),
150 for (int dim = 0; dim < ndims - 2; ++dim) {
275 const int ndims = input.dims(); variable
276 const int64 n = input.dim_size(ndims - 1);
279 context, ndims >
[all...]
H A Dtranspose_functor_gpu.cu.cc36 const int32 ndims, T* dst) {
38 const int32* out_strides = buf + ndims;
39 const int32* perm = buf + ndims * 2;
43 for (int32 i = 0; i < ndims; ++i) {
63 const int32 ndims = in.dims(); local
64 gtl::InlinedVector<int32, 24> host_buf(ndims * 3);
68 for (int i = 0; i < ndims; ++i) {
70 host_buf[ndims + i] = out_strides[i];
71 host_buf[ndims * 2 + i] = perm[i];
86 ndims,
35 TransposeKernel(int nthreads, const T* src, const int32* buf, const int32 ndims, T* dst) argument
[all...]
H A Dmkl_batch_matmul_op.cc61 errors::InvalidArgument("lhs and rhs has different ndims: ",
64 const int ndims = lhs.dims(); variable
66 ctx, ndims >= 2,
67 errors::InvalidArgument("lhs and rhs ndims must be >= 2: ", ndims));
69 for (int i = 0; i < ndims - 2; ++i) {
77 auto batch_size = (ndims == 2) ? 1 : out_shape.num_elements();
78 auto lhs_rows = lhs.dim_size(ndims - 2);
79 auto lhs_cols = lhs.dim_size(ndims - 1);
80 auto rhs_rows = rhs.dim_size(ndims
[all...]
H A Dreduction_ops_common.h98 int ndims() const { return data_reshape_.size(); } function in class:tensorflow::ReductionHelper
156 CHECK_GE(helper.ndims(), 0);
158 if (helper.ndims() == 0 ||
159 (helper.ndims() == 1 && !helper.reduce_first_axis())) {
195 } else if ((helper.ndims() == 1) && helper.reduce_first_axis()) {
199 } else if ((helper.ndims() == 2) && helper.reduce_first_axis()) {
203 } else if ((helper.ndims() == 2) && !helper.reduce_first_axis()) {
207 } else if ((helper.ndims() == 3) && helper.reduce_first_axis()) {
212 } else if ((helper.ndims() == 3) && !helper.reduce_first_axis()) {
/external/tensorflow/tensorflow/compiler/tf2xla/lib/
H A Dbatch_dot.cc45 const int ndims = xla::ShapeUtil::Rank(*x_shape); local
46 if (ndims < 2) {
48 "Arguments to BatchedDot must have rank >= 2: ", ndims);
54 for (int i = 0; i < ndims - 2; ++i) {
64 int x_inner_dim = transpose_x ? (ndims - 2) : (ndims - 1);
65 int y_inner_dim = transpose_y ? (ndims - 1) : (ndims - 2);
82 int x_outer_dim = transpose_x ? (ndims - 1) : (ndims
[all...]
/external/tensorflow/tensorflow/contrib/distributions/python/ops/
H A Dshape.py38 - `ndims`: size of `shape`; number of `Tensor` dimensions,
57 This class partitions `Tensor` notions of `shape`, `ndims`, and `dims` into
240 ndims: Scalar number of dimensions associated with a `Tensor`.
244 ndims = x.get_shape().ndims
245 if ndims is None:
246 return array_ops.rank(x, name="ndims")
247 return ops.convert_to_tensor(ndims, dtype=dtypes.int32, name="ndims")
263 ndims
[all...]
H A Dsample_stats.py371 This function returns the number of dimensions "ndims" of x, as a Python int.
373 The optional expect arguments are used to check the ndims of x, but this is
374 only done if the static ndims of x is not None.
378 expect_static: Expect `x` to have statically defined `ndims`.
387 ndims: A Python integer.
392 ndims = x.get_shape().ndims
393 if ndims is None:
396 ndims = shape_const.ndim
398 if ndims i
[all...]
H A Dindependent.py166 or batch_shape.ndims is None):
168 d = batch_shape.ndims - self._static_reinterpreted_batch_ndims
185 or batch_shape.ndims is None):
187 d = batch_shape.ndims - self._static_reinterpreted_batch_ndims
223 batch_ndims = distribution.batch_shape.ndims
250 ndims = distribution.batch_shape.ndims
251 if ndims is None:
253 ndims = array_ops.shape(distribution.batch_shape_tensor())[0]
256 return which_maximum(0, ndims
[all...]
H A Dmixture_same_family.py149 if (mixture_distribution.event_shape.ndims is not None
150 and mixture_distribution.event_shape.ndims != 0):
162 if mdbs.ndims != 0 and mdbs != cdbs:
244 self._event_shape().ndims) # [n, B, k, [1]*e]
261 self._event_shape().ndims) # [B, k, [1]*e]
279 self._event_shape().ndims) # [B, k, [1]*e]
291 static_event_ndims = self.event_shape.ndims
301 self._event_shape().ndims),
303 self._event_shape().ndims) # [B, k, 1, 1]
316 ndims
[all...]
/external/tensorflow/tensorflow/python/framework/
H A Dtensor_shape.py464 if self.ndims is None:
466 elif self.ndims == 1:
477 def ndims(self): member in class:TensorShape
544 return unknown_shape(ndims=stop - start)
621 if self.ndims is not None and other.ndims is not None:
622 if self.ndims != other.ndims:
635 if self.ndims not in (None, rank):
654 return self.merge_with(unknown_shape(ndims
[all...]
/external/tensorflow/tensorflow/go/
H A Doperation.go89 ndims := C.TF_GraphGetTensorNumDims(p.Op.g.c, port, status.c)
96 if ndims < 0 {
99 if ndims == 0 {
102 dims := make([]C.int64_t, ndims)
103 C.TF_GraphGetTensorShape(p.Op.g.c, port, &dims[0], ndims, status.c)
108 ret := Shape{dims: make([]int64, ndims)}
109 for i := 0; i < int(ndims); i++ {
/external/tensorflow/tensorflow/contrib/tpu/python/tpu/
H A Dtpu_sharding.py173 ndims = shape.ndims
174 if ndims is None:
176 if ndims <= self._shard_dimension:
209 ndims = shape.ndims
210 if ndims is None:
212 if ndims <= self._shard_dimension:
/external/tensorflow/tensorflow/contrib/gan/python/features/python/
H A Dvirtual_batchnorm_impl.py84 if reference_batch.shape.ndims is None:
87 ndims = reference_batch.shape.ndims
89 used_axis = ndims + axis
92 if used_axis < 0 or used_axis >= ndims:
94 ' is out of range for input with rank ' + str(ndims))
198 ndims = input_shape.ndims
199 reduction_axes = list(range(ndims))
205 self._example_reduction_axes = list(range(ndims))
[all...]
/external/tensorflow/tensorflow/python/ops/distributions/
H A Ddistribution.py1124 ndims = x.get_shape().ndims # != sample_ndims
1125 if ndims is None:
1127 ndims = array_ops.rank(x)
1129 math_ops.equal(ndims, 0),
1132 elif ndims == 0:
1140 elif ndims != 1:
1151 ndims = x.get_shape().ndims
1152 sample_ndims = sample_shape.ndims
[all...]
/external/tensorflow/tensorflow/python/ops/
H A Dimage_ops_impl.py206 if image.get_shape().ndims is None:
333 if shape.ndims == 3 or shape.ndims is None:
335 elif shape.ndims == 4:
363 if shape.ndims == 3 or shape.ndims is None:
365 elif shape.ndims == 4:
395 if shape.ndims == 3 or shape.ndims is None:
397 elif shape.ndims
[all...]
/external/tensorflow/tensorflow/contrib/kernel_methods/python/
H A Dlosses.py76 logits_rank = logits.get_shape().ndims
92 labels_rank = labels.get_shape().ndims
103 weights_rank = weights.get_shape().ndims
/external/tensorflow/tensorflow/contrib/losses/python/losses/
H A Dloss_ops.py60 start_index = max(0, weights.get_shape().ndims)
61 reduction_indices = list(range(start_index, losses.get_shape().ndims))
132 if losses.get_shape().ndims is None:
133 raise ValueError("losses.get_shape().ndims cannot be None")
135 if weights_shape.ndims is None:
136 raise ValueError("weights.get_shape().ndims cannot be None")
138 if weights_shape.ndims > 1 and weights_shape.dims[-1].is_compatible_with(1):
172 if weights.get_shape().ndims == 0:
185 if weights.get_shape().ndims >= 1:
186 reduction_indices = list(range(1, weights.get_shape().ndims))
[all...]

Completed in 4075 milliseconds

123456789