syntax = "proto2";

import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";

package tensorflow.tfprof;

message TFProfTensorProto {
  optional DataType dtype = 1;
  // Flatten tensor in row-major.
  // Only one of the following array is set.
  repeated double value_double = 2;
  repeated int64 value_int64 = 3;
  repeated string value_str = 4;
}

message TFProfNode {
  // op name.
  optional string name = 1;
  // tensor value restored from checkpoint.
  optional TFProfTensorProto tensor_value = 15;
  // op execution time.
  optional int64 exec_micros = 2;
  // Total requested bytes by the op.
  optional int64 requested_bytes = 3;
  // Number of parameters if available.
  optional int64 parameters = 4;
  // Number of float operations.
  optional int64 float_ops = 13;
  // Number of inputs to the op.
  optional int64 inputs = 5;
  // Device the op is assigned to.
  optional string device = 10;

  // The following are the aggregated stats from all accounted descendants and
  // the op itself. The actual descendants depend on the data structure used
  // (scope, graph).
  optional int64 total_exec_micros = 6;
  optional int64 total_requested_bytes = 7;
  optional int64 total_parameters = 8;
  optional int64 total_float_ops = 14;
  optional int64 total_inputs = 9;

  // shape information, if available.
  repeated TensorShapeProto shapes = 11;
  // Descendants of the graph. The actual descendants depend on the data
  // structure used (scope, graph).
  repeated TFProfNode children = 12;
}