1// Protocol buffer representing the shape of tensors. 2 3syntax = "proto3"; 4option cc_enable_arenas = true; 5option java_outer_classname = "TensorShapeProtos"; 6option java_multiple_files = true; 7option java_package = "org.tensorflow.framework"; 8option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto"; 9 10package tensorflow; 11 12// Dimensions of a tensor. 13message TensorShapeProto { 14 // One dimension of the tensor. 15 message Dim { 16 // Size of the tensor in that dimension. 17 // This value must be >= -1, but values of -1 are reserved for "unknown" 18 // shapes (values of -1 mean "unknown" dimension). Certain wrappers 19 // that work with TensorShapeProto may fail at runtime when deserializing 20 // a TensorShapeProto containing a dim value of -1. 21 int64 size = 1; 22 23 // Optional name of the tensor dimension. 24 string name = 2; 25 }; 26 27 // Dimensions of the tensor, such as {"input", 30}, {"output", 40} 28 // for a 30 x 40 2D tensor. If an entry has size -1, this 29 // corresponds to a dimension of unknown size. The names are 30 // optional. 31 // 32 // The order of entries in "dim" matters: It indicates the layout of the 33 // values in the tensor in-memory representation. 34 // 35 // The first entry in "dim" is the outermost dimension used to layout the 36 // values, the last entry is the innermost dimension. This matches the 37 // in-memory layout of RowMajor Eigen tensors. 38 // 39 // If "dim.size()" > 0, "unknown_rank" must be false. 40 repeated Dim dim = 2; 41 42 // If true, the number of dimensions in the shape is unknown. 43 // 44 // If true, "dim.size()" must be 0. 45 bool unknown_rank = 3; 46}; 47