-
Notifications
You must be signed in to change notification settings - Fork 965
/
Copy pathops.pbtxt
824 lines (752 loc) · 25.5 KB
/
ops.pbtxt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
op {
name: "Add"
input_arg {
name: "x"
type_attr: "T"
}
input_arg {
name: "y"
type_attr: "T"
}
output_arg {
name: "z"
type_attr: "T"
}
attr {
name: "axis"
type: "int"
}
summary: "Returns x + y element-wise."
description: "*NOTE*: `Add` supports broadcasting."
}
op {
name: "BatchNorm"
attr {
name: "axis"
type: "int"
description: "The axis that should be normalized (typically the features axis). For instance, after a Convolution2D layer with data_format=\"channels_first\", set axis=1 in BatchNormalization"
}
attr {
name: "momentum"
type: "float"
default_value {
f: 0.99
}
description: "Momentum for the moving average."
}
attr {
name: "epsilon"
type: "float"
default_value {
f: 0.0001
}
}
attr {
name: "scale"
type: "bool"
default_value {
b: True
}
description: "If True, multiply by gamma. If False, gamma is not used. When the next layer is linear (also e.g. nn.relu), this can be disabled since the scaling can be done by the next layer."
}
attr {
name: "bias"
type: "bool"
default_value {
b: True
}
description: " If True, add offset of beta to normalized tensor. If False, beta is ignored."
}
attr {
name: "data_format"
type: "string"
default_value {
s: "NHWC"
}
description: "The data format for x and y. Either 'NHWC' (default) or 'NCHW'."
}
attr {
name: "is_training"
type: "bool"
default_value {
b: true
}
description: "A bool value to indicate the operation is for training (default) or inference."
}
summary: "tf.layers.batch_normalization"
description: "Follow Keras FusedBatchNorm, parameters are [scale], [bias], [mean], [var]."
}
op {
name: "Concat"
attr {
name: "axis"
type: "int"
}
summary: "Concatenates tensors along one dimension."
}
op {
name: "Crop"
attr {
name: "border"
type: "list(int). A 1-D values of (leftBorder, topBorder, rightBorder, bottomBorder)."
}
summary: "Crop and image to the specified spatial dimensions."
}
op {
name: "Conv"
attr {
name: "use_bias"
type: "bool"
default_value {
b: true
}
description: "If use bias"
}
attr {
name: "dilations"
type: "list(int)"
description: "Sequence of N ints >= 1. Specifies the filter upsampling/input downsampling rate. [1, dilation_depth, dilation_height, dilation_width, 1]"
}
attr {
name: "kernel_shape"
description: "The shape of the convolution kernel. [filter_depth, filter_height, filter_width, in_channels, out_channels]"
type: "list(int)"
}
attr {
name: "strides"
type: "list(int)"
description: "1-D tensor of length N. [1, stride_deep, stride_height, stride_width, 1]"
}
attr {
name: "pads"
type: "list(int)"
description: "1-D tensor of length N*2. [x1_begin, x2_begin...x1_end, x2_end,...]"
}
attr {
name: "group"
type: "int"
default_value {
i: 1
}
description: "If g > 1, we restrict the connectivity of each filter to a subset of the input. Specifically, the input and output channels are separated into g groups, and the iith output group channels will be only connected to the iith input group channels."
}
attr {
name: "auto_pad"
type: "string"
description: "The type of padding algorithm to use. Where SAME_UPPER or SAME_LOWER mean pad the input so that the output size match the input.In case of odd number add the extra padding at the end for SAME_UPPER and at the beginning for SAME_LOWER. VALID mean no padding."
allowed_values {
list {
s: "SAME_UPPER"
s: "SAME_LOWER"
s: "VALID"
}
}
}
attr {
name: "data_format"
type: "string"
default_value {
s: "NHWC"
}
allowed_values {
list {
s: "NC"
s: "NWC"
s: "NCW"
s: "NHWC"
s: "NCHW"
s: "NDHWC"
s: "NCDHW"
}
}
}
summary: "Computes a (N-2)-D convolution given N-D `input` and `filter` tensors."
description: "Parameters are [weights] and [bias]. Given an input tensor of shape `[batch, in_depth, in_height, in_width, in_channels]` and a filter kernel tensor of shape `[filter_height, filter_width, in_channels, out_channels]`, this op performs the following:1. Flattens the filter to a 2-D matrix with shape `[filter_height * filter_width * in_channels, output_channels]`. 2. Extracts image patches from the input tensor to form a *virtual* tensor of shape `[batch, out_height, out_width, filter_height * filter_width * in_channels]`. 3. For each patch, right-multiplies the filter matrix and the image patch vector. In detail, with the default NHWC format, output[b, i, j, k] = sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] * filter[di, dj, q, k] Must have `strides[0] = strides[3] = 1`. For the most common case of the same horizontal and vertices strides, `strides = [1, stride, stride, 1]`."
}
op {
name: "ConvTranspose"
attr {
name: "kernel_shape"
description: "Shape [filter_depth, filter_height, filter_width, out_channels, in_channels]. Follow tensorflow conv2d_transpose args."
type: "list(int)"
}
attr {
name: "strides"
type: "list(int)"
description: "1-D tensor of length N. [1, stride_deep, stride_height, stride_width, 1]"
}
attr {
name: "group"
type: "int"
default_value {
i: 1
}
description: "If g > 1, we restrict the connectivity of each filter to a subset of the input. Specifically, the input and output channels are separated into g groups, and the iith output group channels will be only connected to the iith input group channels."
}
attr {
name: "auto_pad"
type: "string"
description: "The type of padding algorithm to use. Where SAME_UPPER or SAME_LOWER mean pad the input so that the output size match the input.In case of odd number add the extra padding at the end for SAME_UPPER and at the beginning for SAME_LOWER. VALID mean no padding."
allowed_values {
list {
s: "SAME_UPPER"
s: "SAME_LOWER"
s: "VALID"
}
}
}
attr {
name: "pads"
type: "list(int)"
description: "1-D tensor of length N*2. [x1_begin, x2_begin...x1_end, x2_end,...]"
}
attr {
name: "data_format"
type: "string"
default_value {
s: "NHWC"
}
allowed_values {
list {
s: "NC"
s: "NWC"
s: "NCW"
s: "NHWC"
s: "NCHW"
s: "NDHWC"
s: "NCDHW"
}
}
}
summary: "Computes a (N-2)-D convolution given N-D `input` and `filter` tensors."
description: "Given an input tensor of shape `[batch, in_depth, in_height, in_width, in_channels]` and a filter / kernel tensor of shape `[filter_height, filter_width, in_channels, out_channels]`, this op performs the following:1. Flattens the filter to a 2-D matrix with shape `[filter_height * filter_width * in_channels, output_channels]`. 2. Extracts image patches from the input tensor to form a *virtual* tensor of shape `[batch, out_height, out_width, filter_height * filter_width * in_channels]`. 3. For each patch, right-multiplies the filter matrix and the image patch vector. In detail, with the default NHWC format, output[b, i, j, k] = sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] * filter[di, dj, q, k] Must have `strides[0] = strides[3] = 1`. For the most common case of the same horizontal and vertices strides, `strides = [1, stride, stride, 1]`."
}
op {
name: "DataInput"
attr {
name: "dtype"
type: "type"
description: "The type of elements in the tensor."
}
attr {
name: "shape"
type: "shape"
description: "The shape of the tensor."
}
summary: "Input Data Layer."
}
op {
name: "Div"
attr {
name: "axis"
type: "int"
}
summary: "Performs element-wise binary division."
}
op {
name: "Dropout"
attr {
name: "keep_prob"
type: "float"
}
attr {
name: "seed"
type: "int"
}
attr {
name: "noise_shape"
type: "list(int)"
}
summary: "Dropout Layer"
description: "With probability keep_prob, outputs the input element scaled up by 1 / keep_prob, otherwise outputs 0. The scaling is so that the expected sum is unchanged."
}
op {
name: "Exp"
input_arg {
name: "x"
}
output_arg {
name: "y"
}
summary: "Computes exponential of x element-wise. y = e^x."
}
op {
name: "Flatten"
summary: "Flatten Layer."
description: "Not directly mapping in Tensorflow. Flatten tensor with shape [batch_size, k]."
}
op {
name: "FullyConnected"
attr {
name: "units"
type: "int"
}
attr {
name: "use_bias"
type: "bool"
default_value {
b: true
}
description: "If use bias"
}
summary: "Y = W * X + b"
description: "Not in Tensorflow. Dense operator in Keras. parameters are [weights], [bias]."
}
op {
name: "Gather"
input_arg {
name: "params"
description: "The tensor from which to gather values. Must be at least rank `axis + 1`."
}
input_arg {
name: "indices"
description: "Index tensor. Must be in range `[0, params.shape[axis])`."
}
output_arg {
name: "output"
description: "Values from `params` gathered from indices given by `indices`, with shape `params.shape[:axis] + indices.shape + params.shape[axis + 1:]`."
}
attr {
name: "axis"
description: "The axis in `params` to gather `indices` from. Defaults to the first dimension. Supports negative indexes."
type: "int"
}
attr {
name: "input_dim"
description: "For Embedding layer. Size of the input vocabulary."
type: "int"
}
attr {
name: "output_dim"
description: "For Embedding layer. Dimension of the embedding output vectors."
type: "int"
}
summary: "Gather slices from `params` axis `axis` according to `indices`."
description: "`indices` must be an integer tensor of any dimension (usually 0-D or 1-D). Produces an output tensor with shape `params.shape[:axis] + indices.shape + params.shape[axis + 1:]`"
}
op {
name: "LeakyRelu"
attr {
name: "alpha"
description: "Slope of the activation function at x < 0."
type: "float"
}
description: "LeakyRelu takes input data (Tensor) and an argument alpha, and produces one output data (Tensor) where the function f(x) = alpha * x for x < 0, f(x) = x for x >= 0, is applied to the data tensor elementwise."
}
op {
name: "Log"
input_arg {
name: "x"
}
output_arg {
name: "y"
}
summary: "Computes natural logarithm of x element-wise."
description: "I.e., y = log_e(x)."
}
op {
name: "Matmul"
summary: "Matrix product that behaves like numpy.matmul."
}
op {
name: "Mul"
attr {
name: "axis"
type: "int"
}
summary: "Performs element-wise binary multiplication."
}
op {
name: "Reciprocal"
input_arg {
name: "x"
}
output_arg {
name: "y"
}
summary: "Computes the reciprocal of x element-wise."
description: "I.e., (y = 1 / x)."
}
op {
name: "Relu"
summary: "Computes rectified linear: `max(features, 0)`."
}
op {
name: "Relu6"
summary: "Computes rectified linear 6: `min(max(features, 0), 6)`."
}
op {
name: "Sigmoid"
summary: "Computes sigmoid of `x` element-wise."
description: "Specifically, `y = 1 / (1 + exp(-x))`."
}
op {
name: "Slice"
attr {
name: "starts"
description: "starts[k] specifies the offset into the kth range specification. The exact dimension this corresponds to will be determined by context. Out-of-bounds values will be silently clamped. If the `k`th bit of `begin_mask` then `begin[k]` is ignored and the full range of the appropriate dimension is used instead. Negative values causes indexing to start from the highest element e.g. If `foo==[1,2,3]` then `foo[-1]==3`."
type: "list(int)"
}
attr {
name: "ends"
description: "`ends[i]` is like `begin` with the exception that `end_mask` is used to determine full ranges."
type: "list(int)"
}
attr {
name: "strides"
description: "`strides[i]` specifies the increment in the `i`th specification after extracting a given element. Negative indices will reverse the original order. Out or range values are clamped to `[0,dim[i]) if slice[i]>0` or `[-1,dim[i]-1] if slice[i] < 0`"
type: "list(int)"
}
summary: "Return a strided slice from `input`."
description: "Note, most python users will want to use the Python `Tensor.__getitem__` or `Variable.__getitem__` rather than this op directly. The goal of this op is to produce a new tensor with a subset of the elements from the `n` dimensional `input` tensor. The subset is chosen using a sequence of `m` sparse range specifications encoded into the arguments of this function. Note, in some cases `m` could be equal to `n`, but this need not be the case. Each range specification entry can be one of the following: - An ellipsis (...). Ellipses are used to imply zero or more dimensions of full-dimension selection and are produced using `ellipsis_mask`. For example, `foo[...]` is the identity slice. - A new axis. This is used to insert a new shape=1 dimension and is produced using `new_axis_mask`. For example, `foo[:, ...]` where `foo` is shape `(3, 4)` produces a `(1, 3, 4)` tensor. - A range `begin:end:stride`. This is used to specify how much to choose from a given dimension. `stride` can be any integer but 0. `begin` is an integer which represents the index of the first value to select while `end` represents the index of the last value to select. The number of values selected in each dimension is `end - begin` if `stride > 0` and `begin - end` if `stride < 0`. `begin` and `end` can be negative where `-1` is the last element, `-2` is the second to last. `begin_mask` controls whether to replace the explicitly given `begin` with an implicit effective value of `0` if `stride > 0` and `-1` if `stride < 0`. `end_mask` is analogous but produces the number required to create the largest open interval. For example, given a shape `(3,)` tensor `foo[:]`, the effective `begin` and `end` are `0` and `3`. Do not assume this is equivalent to `foo[0:-1]` which has an effective `begin` and `end` of `0` and `2`. Another example is `foo[-2::-1]` which reverses the first dimension of a tensor while dropping the last two (in the original order elements). For example `foo = [1,2,3,4]; foo[-2::-1]` is `[4,3]`. - A single index. This is used to keep only elements that have a given index. For example (`foo[2, :]` on a shape `(5,6)` tensor produces a shape `(6,)` tensor. This is encoded in `begin` and `end` and `shrink_axis_mask`. Each conceptual range specification is encoded in the op\'s argument. This encoding is best understand by considering a non-trivial example. In particular, `foo[1, 2:4, None, ..., :-3:-1, :]` will be encoded as ``` begin = [1, 2, x, x, 0, x] # x denotes don\'t care (usually 0) end = [2, 4, x, x, -3, x] strides = [1, 1, x, x, -1, 1] begin_mask = 1<<4 | 1 << 5 = 48 end_mask = 1<<5 = 32 ellipsis_mask = 1<<3 = 8 new_axis_mask = 1<<2 4 shrink_axis_mask = 1<<0 ``` In this case if `foo.shape` is (5, 5, 5, 5, 5, 5) the final shape of the slice becomes (2, 1, 5, 5, 2, 5). Let us walk step by step through each argument specification. 1. The first argument in the example slice is turned into `begin = 1` and `end = begin + 1 = 2`. To disambiguate from the original spec `2:4` we also set the appropriate bit in `shrink_axis_mask`. 2. `2:4` is contributes 2, 4, 1 to begin, end, and stride. All masks have zero bits contributed. 3. None is a synonym for `tf.newaxis`. This means insert a dimension of size 1 dimension in the final shape. Dummy values are contributed to begin, end and stride, while the new_axis_mask bit is set. 4. `...` grab the full ranges from as many dimensions as needed to fully specify a slice for every dimension of the input shape. 5. `:-3:-1` shows the use of negative indices. A negative index `i` associated with a dimension that has shape `s` is converted to a positive index `s + i`. So `-1` becomes `s-1` (i.e. the last element). This conversion is done internally so begin, end and strides receive x, -3, and -1. The appropriate begin_mask bit is set to indicate the start range is the full range (ignoring the x). 6. `:` indicates that the entire contents of the corresponding dimension is selected. This is equivalent to `::` or `0::1`. begin, end, and strides receive 0, 0, and 1, respectively. The appropriate bits in `begin_mask` and `end_mask` are also set. *Requirements*: `0 != strides[i] for i in [0, m)` `ellipsis_mask must be a power of two (only one ellipsis)`"
}
op {
name: "Softmax"
attr {
name: "dim"
type: "int"
default_value {
i: -1
}
}
summary: "Computes softmax activations."
description: "softmax = exp(logits) / reduce_sum(exp(logits), dim)"
}
op {
name: "Split"
attr {
name: "axis"
type: "int"
description: "The dimension along which to split."
}
attr {
name: "split"
type: "int"
description: "The number of ways to split. Must evenly divide value.shape[split_dim]."
has_minimum: true
minimum: 1
}
summary: "Splits a tensor into `num_split` tensors along one dimension."
}
op {
name: "Tanh"
summary: "Computes hyperbolic tangent of `x` element-wise."
}
op {
name: "Elu"
attr {
name: "alpha"
type: "float"
default_value {
f: 1.0
}
}
summary: "Computes exponential linear: `exp(features) - alpha` if < 0, `features` otherwise."
description: "Not directly supported alpha in Tensorflow. See [Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)](http://arxiv.org/abs/1511.07289)"
}
op {
name: "Pad"
attr {
name: "pads"
type: "list(int)"
description: "integer tensor with shape N * 2."
}
attr {
name: "mode"
type: "string"
allowed_values {
list {
s: "CONSTANT"
s: "REFLECT"
s: "SYMMETRIC"
}
}
}
attr {
name: "constant_values"
type: "float"
}
summary: "Padding Layer."
description: "Not directly mapping in Tensorflow. Pads a tensor."
}
op {
name: "Pool"
attr {
name: "global_pooling"
type: "bool"
default_value {
b: false
}
description: "From Caffe. If global_pooling then it will pool over the size of the bottom by doing shape.h = bottom->height and shape_w = bottom->width."
}
attr {
name: "dilation_rate"
type: "list(int)"
description: "Sequence of N ints >= 1. Specifies the filter upsampling/input downsampling rate."
}
attr {
name: "kernel_shape"
description: "Shape `[1, depth, height, wide, 1]`."
type: "list(int)"
}
attr {
name: "strides"
type: "list(int)"
description: "1-D tensor of length N. [1, stride_deep, stride_height, stride_weight, 1]"
}
attr {
name: "pooling_type"
type: "string"
description: "The type of pooling type to use."
allowed_values {
list {
s: "MAX"
s: "AVG"
}
}
}
attr {
name: "audo_pad"
type: "string"
description: "The type of padding algorithm to use."
allowed_values {
list {
s: "SAME_UPPER"
s: "SAME_LOWER"
s: "VALID"
}
}
}
attr {
name: "pads"
type: "list(int)"
description: "1-D tensor of length N*2. [x1_begin, x2_begin...x1_end, x2_end,...]"
}
attr {
name: "data_format"
type: "string"
default_value {
s: "NHWC"
}
allowed_values {
list {
s: "NC"
s: "NWC"
s: "NCW"
s: "NHWC"
s: "NCHW"
s: "NDHWC"
s: "NCDHW"
}
}
}
summary: "Performs an N-D pooling operation."
description: "tf.nn.pool defined"
}
op {
name: "Unpool"
attr {
name: "kernel_shape"
description: "Shape `[1, depth, height, wide, 1]`."
type: "list(int)"
}
attr {
name: "strides"
type: "list(int)"
description: "1-D tensor of length N. [1, stride_deep, stride_height, stride_width, 1]"
}
attr {
name: "audo_pad"
type: "string"
description: "The type of padding algorithm to use."
allowed_values {
list {
s: "SAME_UPPER"
s: "SAME_LOWER"
s: "VALID"
}
}
}
attr {
name: "pads"
type: "list(int)"
description: "1-D tensor of length N*2. [x1_begin, x2_begin...x1_end, x2_end,...]"
allowed_values {
list {
i: 0
f: 0.0
}
}
}
attr {
name: "data_format"
type: "string"
default_value {
s: "NHWC"
}
allowed_values {
list {
s: "NC"
s: "NWC"
s: "NCW"
s: "NHWC"
s: "NCHW"
s: "NDHWC"
s: "NCDHW"
}
}
}
summary: "Performs an N-D unpooling operation."
description: "tf.nn.unpool defined"
}
op {
name: "Mul"
summary: "Returns x * y element-wise."
description: "*NOTE*: `Mul` supports broadcasting. More about broadcasting[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)"
}
op {
name: "Reshape"
attr {
name: "shape"
type: "shape"
description: "The target shape of the tensor."
}
summary: "Reshapes a tensor."
}
op {
name: "RNN"
}
op {
name: "LSTM"
}
op {
name: "GRU"
}
op {
name: "SeparableConvolution"
attr {
name: "strides"
type: "list(int)"
description: "1-D of length 4. The stride of the sliding window for each dimension of `input`."
}
attr {
name: "padding"
type: "string"
description: "The type of padding algorithm to use."
allowed_values {
list {
s: "SAME"
s: "VALID"
}
}
}
attr {
name: "data_format"
type: "string"
default_value {
s: "NHWC"
}
description: "Specify the data format of the input and output data. With the default format \"NHWC\", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be \"NCHW\", the data storage order of: [batch, channels, height, width]."
allowed_values {
list {
s: "NHWC"
s: "NCHW"
}
}
}
}
op {
name: "Sub"
input_arg {
name: "x"
type_attr: "T"
}
input_arg {
name: "y"
type_attr: "T"
}
output_arg {
name: "z"
type_attr: "T"
}
attr {
name: "axis"
type: "int"
}
summary: "Returns x - y element-wise."
description: "*NOTE*: `Add` supports broadcasting."
}
op {
name: "LRN"
attr {
name: "size"
type: "int"
description: "0-D. width of the 1-D normalization window, always odd."
}
attr {
name: "alpha"
type: "float"
description: "A scale factor, without dividing size, usually positive."
}
attr {
name: "beta"
type: "float"
description: "An exponent."
}
attr {
name: "bias"
type: "float"
description: "An offset (usually positive to avoid dividing by 0)."
}
summary: "Local Response Normalization."
description: "The 4-D `input` tensor is treated as a 3-D array of 1-D vectors (along the last dimension), and each vector is normalized independently. Within a given vector, each component is divided by the weighted, squared sum of inputs within `size`. In detail, sqr_sum[a, b, c, d] = sum(input[a, b, c, d - size : d + size + 1] ** 2) output = input / (bias + alpha * sqr_sum) ** beta For details, see [Krizhevsky et al., ImageNet classification with deep convolutional neural networks (NIPS 2012)](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks)."
}
op {
name: "Squeeze"
attr {
name: "squeeze_dims"
type: "list(int)"
default_value {
list {
}
}
description: "If specified, only squeezes the dimensions listed. The dimension index starts at 0. It is an error to squeeze a dimension that is not 1."
}
summary: "Removes dimensions of size 1 from the shape of a tensor."
description: "Given a tensor `input`, this operation returns a tensor of the same type with all dimensions of size 1 removed."
}
op {
name: "DepthwiseConv"
attr {
name: "strides"
type: "list(int)"
description: "1-D of length 4. The stride of the sliding window for each dimension of `input`."
}
attr {
name: "padding"
type: "string"
description: "The type of padding algorithm to use."
allowed_values {
list {
s: "SAME"
s: "VALID"
}
}
}
attr {
name: "data_format"
type: "string"
default_value {
s: "NHWC"
}
description: "Specify the data format of the input and output data. With the default format \"NHWC\", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be \"NCHW\", the data storage order of: [batch, channels, height, width]."
allowed_values {
list {
s: "NHWC"
s: "NCHW"
}
}
}
summary: "Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors."
description: "Given an input tensor of shape `[batch, in_height, in_width, in_channels]` and a filter / kernel tensor of shape `[filter_height, filter_width, in_channels, channel_multiplier]`, containing `in_channels` convolutional filters of depth 1, `depthwise_conv2d` applies a different filter to each input channel (expanding from 1 channel to `channel_multiplier` channels for each), then concatenates the results together. Thus, the output has `in_channels * channel_multiplier` channels. ``` for k in 0..in_channels-1 for q in 0..channel_multiplier-1 output[b, i, j, k * channel_multiplier + q] = sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] * filter[di, dj, k, q]``` Must have `strides[0] = strides[3] = 1`. For the most common case of the same horizontal and vertices strides, `strides = [1, stride, stride, 1]`."
}