/* Copyright 2022 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 xla;

import "tensorflow/compiler/xla/xla_data.proto";

message ScalarProto {
  oneof value {
    int32 i32 = 1;
    int64 i64 = 2;
  }
}

message TensorProto {
  PrimitiveType dtype = 1;
  int64 offset = 2;
  repeated int64 sizes = 3;
  repeated int64 strides = 4;
  bool inout = 5;

  bytes contents = 6;
}

message ArgumentProto {
  oneof argument {
    ScalarProto scalar = 1;
    TensorProto tensor = 2;
  }
}

message ResultProto {
  oneof result {
    ScalarProto scalar = 1;
    TensorProto tensor = 2;
  }
}

message ArgumentsProto {
  repeated ArgumentProto arguments = 1;
}

message ResultsProto {
  repeated ResultProto results = 1;
}
