Skip to content

Implement the type of data in channel #8284

@chengduoZH

Description

@chengduoZH

Currently, the function of Channel of Fluid has been nearly completed. But to use Channel in Fluid, we also need define the data type of Channel.
I think the data type of it should be n-tuple, just like std::tuple. For example, we want to send (image, label) using one channel, rather than using multiple channels.
The following is what I complete ChanDesc, it includes the base-data-type and advanced-data-type.

message MetaData {
  enum DataType {
    BOOL = 1;
    INT16 = 2;
    INT32 = 3;
    INT64 = 4;
    FP16 = 5;
    FP32 = 6;
    FP64 = 7;
    TENSOR = 8;
    LOD_TENSOR = 9;
    SELECTED_ROWS = 10;
    LOD_TENSOR_ARRAY = 11;
    // or others 
  }
  required DataType base_type = 1;
  optional bool data_bool = 2;
  optional int32 data_int32 = 3;
  optional int64 data_int64 = 4;
  optional float data_float = 5;
  optional LoDTensorDesc lod_tensor = 6;
  optional TensorDesc selected_rows = 7;
  optional LoDTensorArrayDesc tensor_array = 8;
}

message ChanEleDesc { repeated MetaData meta_data = 1; }

message ChanDesc {
  repeated ChanEleDesc channel_type = 1;
  required int32 cap = 2 [ default = 0 ];
  required string name = 3;
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions