// Protocol buffer for serializing arbitrary float tensors.
// Note: Currently only floating point feature is supported.

syntax = "proto2";

package delf.protos;

// A DatumProto is a data structure used to serialize tensor with arbitrary
// shape. DatumProto contains an array of floating point values and its shape
// is represented as a sequence of integer values. Values are contained in
// row major order.
//
// Example:
//  3 x 2 array
//
//  [1.1, 2.2]
//  [3.3, 4.4]
//  [5.5, 6.6]
//
//  can be represented with the following DatumProto:
//
//  DatumProto {
//    shape {
//      dim: 3
//      dim: 2
//    }
//    float_list {
//      value: 1.1
//      value: 2.2
//      value: 3.3
//      value: 4.4
//      value: 5.5
//      value: 6.6
//    }
//  }

// DatumShape is array of dimension of the tensor.
message DatumShape {
  repeated int64 dim = 1 [packed = true];
}

// FloatList is a container of tensor values, which are saved as a list of
// floating point values.
message FloatList {
  repeated float value = 1 [packed = true];
}

// Uint32List is a container of tensor values, which are saved as a list of
// uint32 values.
message Uint32List {
  repeated uint32 value = 1 [packed = true];
}

message DatumProto {
  optional DatumShape shape = 1;
  oneof kind_oneof {
    FloatList float_list = 2;
    Uint32List uint32_list = 3;
  }
}

// Groups two DatumProto's.
message DatumPairProto {
  optional DatumProto first = 1;
  optional DatumProto second = 2;
}
