/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

syntax = "proto3";

package tensorflow.contrib.tensorboard;

message TraceInfo {
  repeated OpInfo ops = 1;
  repeated FileInfo files = 2;
}

message OpInfo {
  string name = 1;
  string op_type = 2;
  string device = 3;
  repeated LineTrace traceback = 4;
  repeated TensorInfo inputs = 5;
  repeated TensorInfo outputs = 6;
}

message LineTrace {
  // Absolute file path.
  string file_path = 1;
  // 1-based line number.
  uint32 line_number = 2;
}

message TensorInfo {
  // Size of the tensor for each dimension. Value of -1 denotes "unknown"
  // size for that dimension.
  repeated int32 shape = 1;
  // The data type of the tensor.
  string dtype = 2;
  // Number of bytes per element in the tensor.
  uint32 num_bytes_per_elem = 3;
  // List of operation names that consume this tensor.
  repeated string consumers = 4;
}

message FileInfo {
  // Absolute file path to the source code.
  string file_path = 1;
  string source_code = 2;
  // Map from end of statement to start of statement. End and start are 0-based
  // line indexes.
  map<uint32, uint32> multiline_statements = 3;
}
