File: caffe2_legacy.proto

package info (click to toggle)
pytorch 1.13.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 139,252 kB
  • sloc: cpp: 1,100,274; python: 706,454; ansic: 83,052; asm: 7,618; java: 3,273; sh: 2,841; javascript: 612; makefile: 323; xml: 269; ruby: 185; yacc: 144; objc: 68; lex: 44
file content (50 lines) | stat: -rw-r--r-- 2,100 bytes parent folder | download
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
syntax = "proto2";

package caffe2;

// Original Caffe1 Datum copy: this is used in image input op to allow us to
// load caffe1 serialized datum without having to regenerate the database.
message CaffeDatum {
  optional int32 channels = 1;
  optional int32 height = 2;
  optional int32 width = 3;
  // the actual image data, in bytes
  optional bytes data = 4;
  optional int32 label = 5;
  // Optionally, the datum could also hold float data.
  repeated float float_data = 6;
  // If true data contains an encoded image that need to be decoded
  optional bool encoded = 7 [ default = false ];
}

enum LegacyPadding {
  NOTSET = 0; // Do not use old-stype padding strategies.

  // VALID and SAME are two strategies adopted in Google DistBelief: it forces
  // the input shape as follows. For SAME, the output is:
  //   R_out = ceil(float(R) / float(S))
  //   C_out = ceil(float(C) / float(S))
  // where R and C are row and column, S is the stride, and K is the kernel.
  // The number of padded pixels is then computed as
  //   Pr = ((R_out - 1) * S + K - R)
  //   Pc = ((C_out - 1) * S + K - C)
  // When Pr and Pc are even numbers, both sides (left and right, or top and
  // bottom) get half each. When Pr and Pc are odd numbers, the right and the
  // bottom gets the one additional padding pixel.
  // For VALID, padding values of 0 are always used.
  VALID = 1;
  SAME = 2;

  // CAFFE_LEGACY_POOLING is a flag that notifies the code to use the old Caffe
  // padding strategy.
  // Basically, in caffe2, after padding the convolution and pooling use the
  // same computation strategy: half-windows at the right and bottom are
  // discarded. In Caffe, convolution follows this strategy but if there are
  // some pixels in the half-windows, the pooling layer will actually put one
  // additional output. If you set LegacyPadding to this, we will compute the
  // equivalent padding strategy in caffe2 so that the output size is
  // backward compatible with Caffe.
  // THIS IS NOW DEPRECATED. ANY non-conventional use has to be manually
  // converted.
  CAFFE_LEGACY_POOLING = 3;
}