Home
last modified time | relevance | path

Searched refs:input_shape (Results 1 – 25 of 462) sorted by relevance

12345678910>>...19

/external/tensorflow/tensorflow/python/keras/_impl/keras/applications/
Dimagenet_utils.py248 def _obtain_input_shape(input_shape, argument
274 if weights != 'imagenet' and input_shape and len(input_shape) == 3:
276 if input_shape[0] not in {1, 3}:
279 str(input_shape[0]) + ' input channels.')
280 default_shape = (input_shape[0], default_size, default_size)
282 if input_shape[-1] not in {1, 3}:
285 str(input_shape[-1]) + ' input channels.')
286 default_shape = (default_size, default_size, input_shape[-1])
293 if input_shape is not None:
294 if input_shape != default_shape:
[all …]
Dmobilenet_test.py63 input_shape = (None, None, 1)
66 input_shape=input_shape)
69 input_shape = (None, None, 4)
72 input_shape=input_shape)
80 input_shape = (size, size, 3)
81 model = keras.applications.MobileNet(input_shape=input_shape,
84 self.assertEqual(model.input_shape, (None,) + input_shape)
87 input_shape = (3, size, size)
88 model = keras.applications.MobileNet(input_shape=input_shape,
91 self.assertEqual(model.input_shape, (None,) + input_shape)
[all …]
Dimagenet_utils_test.py95 input_shape=(224, 224, 3),
107 input_shape = shape + (3,)
109 input_shape = (3,) + shape
112 input_shape=input_shape,
121 input_shape = shape + (3,)
123 input_shape = (3,) + shape
126 input_shape=input_shape,
135 input_shape = shape + (5,)
137 input_shape = (5,) + shape
140 input_shape=input_shape,
[all …]
Dmobilenet.py218 def build(self, input_shape): argument
219 if len(input_shape) < 4:
221 'Received input shape:', str(input_shape))
226 if input_shape[channel_axis] is None:
230 input_dim = int(input_shape[channel_axis])
272 def compute_output_shape(self, input_shape): argument
274 rows = input_shape[2]
275 cols = input_shape[3]
276 out_filters = input_shape[1] * self.depth_multiplier
278 rows = input_shape[1]
[all …]
/external/tensorflow/tensorflow/python/keras/_impl/keras/layers/
Dconvolutional.py1048 def compute_output_shape(self, input_shape): argument
1049 input_shape = tensor_shape.TensorShape(input_shape).as_list()
1050 size = self.size * input_shape[1] if input_shape[1] is not None else None
1051 return tensor_shape.TensorShape([input_shape[0], size, input_shape[2]])
1105 def compute_output_shape(self, input_shape): argument
1106 input_shape = tensor_shape.TensorShape(input_shape).as_list()
1108 height = self.size[0] * input_shape[
1109 2] if input_shape[2] is not None else None
1110 width = self.size[1] * input_shape[
1111 3] if input_shape[3] is not None else None
[all …]
Dcore.py85 def compute_output_shape(self, input_shape): argument
86 return input_shape
173 input_shape = K.shape(inputs)
174 noise_shape = (input_shape[0], 1, input_shape[2])
225 input_shape = K.shape(inputs)
227 return (input_shape[0], input_shape[1], 1, 1)
229 return (input_shape[0], 1, 1, input_shape[3])
278 input_shape = K.shape(inputs)
280 return (input_shape[0], input_shape[1], 1, 1, 1)
282 return (input_shape[0], 1, 1, 1, input_shape[4])
[all …]
Dpooling_test.py31 input_shape=(3, 4, 5))
33 keras.layers.pooling.GlobalAveragePooling1D, input_shape=(3, 4, 5))
40 input_shape=(3, 4, 5, 6))
44 input_shape=(3, 5, 6, 4))
48 input_shape=(3, 4, 5, 6))
52 input_shape=(3, 5, 6, 4))
59 input_shape=(3, 4, 3, 4, 3))
63 input_shape=(3, 4, 3, 4, 3))
67 input_shape=(3, 4, 3, 4, 3))
71 input_shape=(3, 4, 3, 4, 3))
[all …]
Dmerge.py84 def build(self, input_shape): argument
86 if not isinstance(input_shape, list):
88 if len(input_shape) < 2:
91 'Got ' + str(len(input_shape)) + ' inputs.')
92 batch_sizes = [s[0] for s in input_shape if s is not None]
98 'batch sizes. Got tensors with shapes : ' + str(input_shape))
99 if input_shape[0] is None:
102 output_shape = input_shape[0][1:]
103 for i in range(1, len(input_shape)):
104 if input_shape[i] is None:
[all …]
Dcore_test.py36 keras.layers.Masking, kwargs={}, input_shape=(3, 2, 3))
41 keras.layers.Dropout, kwargs={'rate': 0.5}, input_shape=(3, 2))
48 input_shape=(3, 2))
59 input_shape=(2, 3, 4))
65 input_shape=(2, 3, 4, 5))
71 input_shape=(2, 3, 4, 5))
77 input_shape=(2, 3, 4, 4, 5))
83 input_shape=(2, 3, 4, 4, 5))
91 input_shape=(3, 2))
98 input_shape=(3, 2))
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/
Dpool_test.py147 def _test(self, input_shape, **kwargs): argument
151 np.prod(input_shape), dtype=np.float32).reshape(input_shape) - 1
161 input_shape=[1, 1, 10, 1],
172 for input_shape in [[2, 9, 2], [2, 10, 2]]:
177 input_shape=input_shape,
187 input_shape=input_shape,
198 for input_shape in [[2, 9, 10, 2], [2, 10, 9, 2]]:
203 input_shape=input_shape,
213 input_shape=input_shape,
224 for input_shape in [[2, 9, 10, 11, 2], [2, 10, 9, 11, 2]]:
[all …]
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
Dsplit_op.cc38 const TensorShape input_shape = ctx->InputShape(1); in Compile() local
57 int32 split_dim = split_dim_orig < 0 ? split_dim_orig + input_shape.dims() in Compile()
59 OP_REQUIRES(ctx, 0 <= split_dim && split_dim < input_shape.dims(), in Compile()
60 errors::InvalidArgument("-input rank(-", input_shape.dims(), in Compile()
62 input_shape.dims(), "), but got ", in Compile()
71 ctx, input_shape.dim_size(split_dim) % num_split == 0, in Compile()
75 split_dim_orig, " (size = ", input_shape.dim_size(split_dim), ") ", in Compile()
80 const int32 slice_size = input_shape.dim_size(split_dim) / num_split; in Compile()
84 std::vector<int64> begin(input_shape.dims(), 0); in Compile()
85 std::vector<int64> limits(input_shape.dims()); in Compile()
[all …]
Dshape_op.cc36 const TensorShape input_shape = ctx->InputShape(0); in Compile() local
37 Tensor shape_constant(out_dtype_, TensorShape({input_shape.dims()})); in Compile()
38 OP_REQUIRES_OK(ctx, TensorShapeToConstant(input_shape, &shape_constant)); in Compile()
56 const TensorShape input_shape = ctx->InputShape(i); in Compile() local
57 Tensor shape_constant(out_dtype_, TensorShape({input_shape.dims()})); in Compile()
58 OP_REQUIRES_OK(ctx, TensorShapeToConstant(input_shape, &shape_constant)); in Compile()
75 const TensorShape input_shape = ctx->InputShape(0); in Compile() local
76 const int rank = input_shape.dims(); in Compile()
91 const TensorShape input_shape = ctx->InputShape(0); in Compile() local
92 const int64 size = input_shape.num_elements(); in Compile()
[all …]
Dunpack_op.cc47 const TensorShape input_shape = ctx->InputShape(0); in Compile() local
50 if (axis < 0) axis += input_shape.dims(); in Compile()
52 OP_REQUIRES(ctx, 0 <= axis && axis < input_shape.dims(), in Compile()
54 -input_shape.dims(), ", ", in Compile()
55 input_shape.dims(), ")")); in Compile()
58 ctx, input_shape.dims() > 0 && input_shape.dim_size(axis) == num, in Compile()
60 ", got shape ", input_shape.DebugString())); in Compile()
62 auto output_shape = input_shape; in Compile()
67 std::vector<int64> start_indices(input_shape.dims(), 0); in Compile()
68 std::vector<int64> limit_indices(input_shape.dims()); in Compile()
[all …]
Dspacetodepth_op.cc50 const gtl::InlinedVector<int64, 4> input_shape = in Compile() local
68 OP_REQUIRES(ctx, input_shape[1 + i] % block_size_ == 0, in Compile()
70 "input shape[", 1 + i, "]=", input_shape[1 + i], in Compile()
75 reshaped_shape.push_back(input_shape[0]); in Compile()
77 reshaped_shape.push_back(input_shape[1 + i] / block_size_); in Compile()
80 reshaped_shape.push_back(input_shape[feature_dim]); in Compile()
91 output_shape.push_back(input_shape[0]); in Compile()
93 output_shape.push_back(input_shape[1 + i] / block_size_); in Compile()
95 output_shape.push_back(input_shape[feature_dim] * block_elems); in Compile()
100 OP_REQUIRES(ctx, input_shape[2 + i] % block_size_ == 0, in Compile()
[all …]
Dimage_ops.cc87 const TensorShape input_shape = context->InputShape(0); in Compile() local
88 OP_REQUIRES(context, input_shape.dims() >= 1, in Compile()
90 input_shape.DebugString())); in Compile()
91 int channel_dim = input_shape.dims() - 1; in Compile()
92 int64 channels = input_shape.dim_size(channel_dim); in Compile()
110 TensorShape channel_shape = input_shape; in Compile()
125 const TensorShape input_shape = context->InputShape(0); in Compile() local
126 OP_REQUIRES(context, input_shape.dims() >= 1, in Compile()
128 input_shape.DebugString())); in Compile()
129 int channel_dim = input_shape.dims() - 1; in Compile()
[all …]
Ddepthtospace_op.cc50 const gtl::InlinedVector<int64, 4> input_shape = in Compile() local
66 reshaped_shape.push_back(input_shape[0]); in Compile()
68 reshaped_shape.push_back(input_shape[1 + i]); in Compile()
75 reshaped_shape.push_back(input_shape[feature_dim] / block_elems); in Compile()
84 output_shape.push_back(input_shape[0]); in Compile()
86 output_shape.push_back(input_shape[1 + i] * block_size_); in Compile()
88 output_shape.push_back(input_shape[feature_dim] / block_elems); in Compile()
91 reshaped_shape.push_back(input_shape[0]); in Compile()
97 reshaped_shape.push_back(input_shape[feature_dim] / block_elems); in Compile()
99 reshaped_shape.push_back(input_shape[2 + i]); in Compile()
[all …]
Dslice_op.cc38 const TensorShape input_shape = ctx->InputShape(0); in Compile() local
46 begin_tensor_shape.num_elements() == input_shape.dims() && in Compile()
47 size_tensor_shape.num_elements() == input_shape.dims(), in Compile()
50 input_shape.dims(), ", but got shapes ", in Compile()
54 const int input_dims = input_shape.dims(); in Compile()
64 size[i] = input_shape.dim_size(i) - begin[i]; in Compile()
71 if (input_shape.dim_size(i) == 0) { in Compile()
78 OP_REQUIRES(ctx, 0 <= b && b <= input_shape.dim_size(i), in Compile()
80 input_shape.dim_size(i), in Compile()
82 OP_REQUIRES(ctx, 0 <= s && b + s <= input_shape.dim_size(i), in Compile()
[all …]
/external/tensorflow/tensorflow/python/framework/
Dcommon_shapes.py178 input_shape = op.inputs[0].get_shape().with_rank(4)
188 input_shape = [input_shape[0], input_shape[2], input_shape[3],
189 input_shape[1]]
191 batch_size = input_shape[0]
192 in_rows = input_shape[1]
193 in_cols = input_shape[2]
199 input_shape[3].assert_is_compatible_with(filter_shape[2])
247 input_shape = op.inputs[0].get_shape().with_rank(4)
250 batch_size = input_shape[0]
251 in_rows = input_shape[1]
[all …]
/external/tensorflow/tensorflow/python/layers/
Dpooling.py93 def compute_output_shape(self, input_shape): argument
94 input_shape = tensor_shape.TensorShape(input_shape).as_list()
95 length = utils.conv_output_length(input_shape[1], self.pool_size[0],
97 return tensor_shape.TensorShape([input_shape[0], length, input_shape[2]])
285 def compute_output_shape(self, input_shape): argument
286 input_shape = tensor_shape.TensorShape(input_shape).as_list()
288 rows = input_shape[2]
289 cols = input_shape[3]
291 rows = input_shape[1]
292 cols = input_shape[2]
[all …]
Dcore.py124 def build(self, input_shape): argument
125 input_shape = tensor_shape.TensorShape(input_shape)
126 if input_shape[-1].value is None:
130 axes={-1: input_shape[-1].value})
132 shape=[input_shape[-1].value, self.units],
169 def compute_output_shape(self, input_shape): argument
170 input_shape = tensor_shape.TensorShape(input_shape)
171 input_shape = input_shape.with_rank_at_least(2)
172 if input_shape[-1].value is None:
175 % input_shape)
[all …]
/external/tensorflow/tensorflow/contrib/fused_conv/python/ops/
Dfused_conv2d_bias_activation_benchmark.py32 def build_conv_bias_relu_graph(device, input_shape, filter_shape, strides, argument
52 input_shape = [
53 input_shape[0], input_shape[3], input_shape[1], input_shape[2]
56 inp = variables.Variable(random_ops.truncated_normal(input_shape))
77 def build_fused_conv_bias_relu_graph(device, input_shape, filter_shape, strides, argument
97 input_shape = [
98 input_shape[0], input_shape[3], input_shape[1], input_shape[2]
101 inp = variables.Variable(random_ops.truncated_normal(input_shape))
134 def _run_graph(self, device, input_shape, filter_shape, strides, padding, argument
156 outputs = build_fused_conv_bias_relu_graph(device, input_shape,
[all …]
/external/tensorflow/tensorflow/contrib/lite/toco/graph_transformations/
Dpropagate_fixed_sizes.cc32 void ComputeConvSizes(const Shape& input_shape, int output_depth, int kwidth, in ComputeConvSizes() argument
36 const int input_width = input_shape.dims(2); in ComputeConvSizes()
37 const int input_height = input_shape.dims(1); in ComputeConvSizes()
38 const int batch = input_shape.dims(0); in ComputeConvSizes()
153 const auto& input_shape = input_array.shape(); in ProcessConvOperator() local
154 CHECK_EQ(input_shape.dimensions_count(), 4); in ProcessConvOperator()
168 ComputeConvSizes(input_shape, output_depth, kwidth, kheight, op->stride_width, in ProcessConvOperator()
195 const auto& input_shape = input_array.shape(); in ProcessDepthwiseConvOperator() local
196 CHECK_EQ(input_shape.dimensions_count(), 4); in ProcessDepthwiseConvOperator()
207 const int input_depth = input_shape.dims(3); in ProcessDepthwiseConvOperator()
[all …]
/external/tensorflow/tensorflow/python/ops/
Dconcat_benchmark.py35 def build_graph(device, input_shape, variable, num_inputs, axis, grad): argument
51 inputs = [array_ops.zeros(input_shape) for _ in range(num_inputs)]
56 input_shape[0],
57 random.randint(max(1, input_shape[1] - 5), input_shape[1] + 5)
63 random.randint(max(1, input_shape[0] - 5), input_shape[0] + 5),
64 input_shape[1]
81 def _run_graph(self, device, input_shape, variable, num_inputs, axis, grad, argument
99 outputs = build_graph(device, input_shape, variable, num_inputs, axis,
112 "GB/sec" % (device, input_shape[0], input_shape[1], variable,
114 num_inputs * input_shape[0] * input_shape[1] * 4 * 2 *
[all …]
/external/tensorflow/tensorflow/contrib/model_pruning/python/layers/
Dcore_layers.py124 def build(self, input_shape): argument
125 input_shape = tensor_shape.TensorShape(input_shape)
127 if input_shape[channel_axis].value is None:
130 input_dim = input_shape[channel_axis].value
213 def compute_output_shape(self, input_shape): argument
214 input_shape = tensor_shape.TensorShape(input_shape).as_list()
216 space = input_shape[1:-1]
226 return tensor_shape.TensorShape([input_shape[0]] + new_space +
229 space = input_shape[2:]
239 return tensor_shape.TensorShape([input_shape[0], self.filters] +
[all …]
/external/tensorflow/tensorflow/core/api_def/base_api/
Dapi_def_BatchToSpaceND.pbtxt6 N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`,
23 `crop_start[i] + crop_end[i] <= block_shape[i] * input_shape[i + 1]`.
30 input_shape[1], ..., input_shape[N-1]]
35 input_shape[1], block_shape[0],
37 input_shape[M], block_shape[M-1],
39 input_shape[M+1], ..., input_shape[N-1]]
44 input_shape[1] * block_shape[0],
46 input_shape[M] * block_shape[M-1],
48 input_shape[M+1],
50 input_shape[N-1]]
[all …]

12345678910>>...19