This commit is contained in:
Yuanchao Shu 2019-10-31 23:18:30 -07:00
Коммит f98deb1ee6
138 изменённых файлов: 38889 добавлений и 0 удалений

14
CONTRIBUTING.md Normal file
Просмотреть файл

@ -0,0 +1,14 @@
# Contributing
This project welcomes contributions and suggestions. Most contributions require you to
agree to a Contributor License Agreement (CLA) declaring that you have the right to,
and actually do, grant us the rights to use your contribution. For details, visit
https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

10
Config.bat Normal file
Просмотреть файл

@ -0,0 +1,10 @@
powershell -Command "New-Item -ItemType directory -Path ./src/VAP/TFWrapper/packages/TensorFlowSharp.1.12.0/runtimes/win7-x64/native/"
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://aka.ms/Microsoft-Rocket-Video-Analytics-Platform-libtensorflow.dll', './src/VAP/TFWrapper/packages/TensorFlowSharp.1.12.0/runtimes/win7-x64/native/libtensorflow.dll')"
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://aka.ms/Microsoft-Rocket-Video-Analytics-Platform-opencv_world340.dll', './src/VAP/YoloWrapper/Dependencies/opencv_world340.dll')"
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://aka.ms/Microsoft-Rocket-Video-Analytics-Platform-opencv_world340d.dll', './src/VAP/YoloWrapper/Dependencies/opencv_world340d.dll')"
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://pjreddie.com/media/files/yolov3.weights', './src/VAP/YoloWrapper/Yolo.Config/YoloV3Coco/yolov3.weights')"
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://pjreddie.com/media/files/yolov3-tiny.weights', './src/VAP/YoloWrapper/Yolo.Config/YoloV3TinyCoco/yolov3-tiny.weights')"

21
LICENSE Normal file
Просмотреть файл

@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

63
README.md Normal file
Просмотреть файл

@ -0,0 +1,63 @@
# Microsoft Rocket Video Analytics Platform
A highly extensible software stack to empower everyone to build practical real-world live video analytics applications for object detection and alerting with cutting edge machine learning algorithms. The repository features a hybrid edge-cloud video analytics pipeline (built on **C# .NET Core**), which allows **TensorFlow DNN model plug-in**, **GPU/FPGA acceleration**, **docker containerization/Kubernetes orchestration**, and **interactive querying** for after-the-fact analysis.
## How to run the code
Microsoft Rocket Video Analytics Platform is currently in preview.
### Step 1: Set up environment
[Microsoft Visual Studio](https://visualstudio.microsoft.com/downloads/) (VS 2017 is preferred) is recommended IDE for Rocket. While installing Visual Studio, please also add C++ 2015.3 v14.00 (v140) toolset to your local machine. Snapshot below shows how to include C++ 2015.3 v14.00 from Visual Studio Installer.
<img src="https://mntmwg.dm.files.1drv.com/y4mqIJhU_BMCDfndscmI1apnWjXOAd0FAGvjAuyVVt5tJyGgahURnXi4L8SMO9Wxw00IvLRp0cN4PEhhM1OevN28O8ejxoU5KY7syzsn6BWEPARNyabivS28P_PG1CznLltnPKfmt9pv4qMgVo-MV38XL2Snl8g6lPMaqIa6YWbgmxFfSAzeqbULngzrabIRyTy3lSDLrd39PEFnTwK-avkrQ?width=1608&height=1033&cropmode=none" alt="C++v140" width="600">
Follow [instructions](https://dotnet.microsoft.com/download) to install .NET Core 2.2 (2.2.102 is preferred).
To enable GPU support, install [CUDA Toolkit](https://developer.nvidia.com/cuda-downloads) and [cuDNN](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#download).
* **CUDA 8.0** (e.g., cuda_8.0.61_win10_network.exe) is needed for Darknet (e.g., YOLO) models.
Please make sure files in `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\extras\visual_studio_integration\MSBuildExtensions` are copied to `C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\BuildCustomizations`
* **CUDA 9.1** (e.g., cuda_9.1.85_win10_network.exe) is needed to support TensorFlow models.
* **cuDNN 8.0** is preferred (e.g., cudnn-8.0-windows10-x64-v7.2.1.38.zip).
Copy `<installpath>\cuda\bin\cudnn64_7.dll` to `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin`.
Copy `<installpath>\cuda\ include\cudnn.h` to `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include`.
Copy `<installpath>\cuda\lib\x64\cudnn.lib` to `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64`.
Add Variable Name: `CUDA_PATH` with Variable Value: `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0` into Environment Variables.
* **Restart your computer** after installing CUDA and cuDNN.
### Step 2: Run the pipeline
Check out the [repository](https://aka.ms/Microsoft-Rocket-Video-Analytics-Platform/).
#### Build on Windows
* Prepare video feeds. Rocket can be fed with either live video streams (e.g., `rtsp://<url>:<port>/`) or local video files (should be put into `\media\`). A sample video file `sample.mp4` is already included in `\media\`.
* Prepare a configuration file (should be placed into `\cfg\`) used in line-based alerting and cascaded DNN calls. Each line in the file defines a line-of-interest with the format below.
`<line_name> <line_id> <x_1> <y_1> <x_2> <y_2> <overlap_threshold>`
A line configuration file `sample.txt` manually created based on `sample.mp4` is also included in the folder `\cfg\`.
* Run `Config.bat` before the first time you run Rocket to download pre-compiled OpenCV and TensorFlow binaries as well as Darknet YOLO weights files. It may take few minutes depending on your network status. Proceed only when all downloads finish.
* Launch `VAP.sln` in `src\VAP\` from Visual Studio.
* Set pipeline config `PplConfig` in VideoPipelineCore - App.config. We have pre-compiled six configurations in the code.
* 0: Line-based alerting
* 1: Darknet Yolo v3 on every frame
* 2: TensorFlow FastRCNN on every frame
* 3: Background subtraction-based (BGS) early filtering -> Darknet Tiny Yolo -> Darknet Yolo v3
* 4: BGS early filtering -> Darknet Tiny Yolo -> Database (ArangoDB and blob storage on Azure)
* 5: BGS early filtering -> TensorFlow Fast R-CNN -> Azure Machine Learning (cloud)
* (Optional) Set up your own database and Azure Machine Learning Service if `PplConfig` is set to 4 or 5.
* Azure Database (e.g., SQL database like [MySQL](https://azure.microsoft.com/en-us/services/mysql/) or NoSQL database such as [ArangoDB](https://azuremarketplace.microsoft.com/en/marketplace/apps/arangodb.arangodb?tab=Overview)).
* Azure Machine Learning: deploy your models to an [Azure FPGA](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-deploy-fpga-web-service).
* Build the solution.
* Run the code.
* Using Visual Studio: set VideoPipelineCore - Property - Debug - Application Arguments `<video_file/camera_url> <line_detection_config_file> <sampling_factor> <resolution_factor> <object_category>`. To run Rocket on the sample video, for example, arguments can be set to `sample.mp4 sample.txt 1 1 car`.
* Using Command Line (CMD or PowerShell): run `dotnet .\VideoPipelineCore.dll <video_file/camera_url> <line_detection_config_file> <sampling_factor> <resolution_factor> <object_category>` in `\src\VAP\VideoPipelineCore\bin\Debug\netcoreapp2.2`. For instance, `dotnet .\VideoPipelineCore.dll sample.mp4 sample.txt 1 1 car`.
### Step 3: Results
Output images are generated in `\src\VAP\VideoPipelineCore\bin\output`. You should also see results in console during running.

74
ThirdPartyNotices.md Normal file
Просмотреть файл

@ -0,0 +1,74 @@
Microsoft Rocket Video Analytics Platform uses third-party material as listed
below. The attached notices are provided for informational purposes only.
Notice for opencvsharp
-------------------------------
BSD 3-Clause License
Copyright (c) 2019, shimat
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------
Notice for TensorFlowSharp
-------------------------------
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-------------------------------
Notice for YOLO
-------------------------------
THIS SOFTWARE LICENSE IS PROVIDED "ALL CAPS" SO THAT YOU KNOW IT IS SUPER
SERIOUS AND YOU DON'T MESS AROUND WITH COPYRIGHT LAW BECAUSE YOU WILL GET IN
TROUBLE HERE ARE SOME OTHER BUZZWORDS COMMONLY IN THESE THINGS WARRANTIES
LIABILITY CONTRACT TORT LIABLE CLAIMS RESTRICTION MERCHANTABILITY. NOW HERE'S
THE REAL LICENSE:
0. Darknet is public domain.
1. Do whatever you want with it.
2. Stop emailing me about it!
-------------------------------

1000
cfg/imagenet-classes.json Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

1
cfg/sample.txt Normal file
Просмотреть файл

@ -0,0 +1 @@
Left-entrance 1 209 101 266 101 0.3

Двоичные данные
media/sample.mp4 Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\..\cfg\imagenet-classes.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.10.0" />
<PackageReference Include="Grpc" Version="2.24.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="protobuf" Version="2.6.1.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AML.tfserving\AML.tfserving.csproj" />
<ProjectReference Include="..\TFDetector\TFDetector.csproj" />
<ProjectReference Include="..\Utils\Utils.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,137 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using DNNDetector.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Threading.Tasks;
using System.IO;
using System.Linq;
using System.Reflection;
using Utils.Config;
namespace AML.Client
{
public class AMLCaller
{
static string Host;
static bool UseSSL;
static string Auth;
static string AksServiceName;
static string InputName = "Placeholder:0";
static string OutputName = "classifier/resnet_v1_50/predictions/Softmax:0";
public AMLCaller(string host, bool useSSL, string auth, string aksServiceName)
{
try
{
Host = host;
UseSSL = useSSL;
Auth = auth;
AksServiceName = aksServiceName;
}
catch (Exception e)
{
Console.WriteLine("AML init error:" + e);
}
Utils.Utils.cleanFolder(@OutputFolder.OutputFolderAML);
}
public static async Task<List<bool>> Run(int frameIndex, List<Item> items, Dictionary<string, int> category)
{
//could implement AML triggering criteria here, e.g., confidence
if (items == null)
{
return null;
}
var client = new ScoringClient(Host, UseSSL ? 443 : 80, UseSSL, Auth, AksServiceName);
List<bool> amlResult = new List<bool>();
for (int itemIndex = 0; itemIndex < items.Count(); itemIndex++)
{
MemoryStream mStream = new MemoryStream();
using (Image image = Image.FromStream(new MemoryStream(items[itemIndex].CroppedImageData)))
{
image.Save(mStream, ImageFormat.Png);
mStream.Position = 0;
}
using (mStream)
{
IScoringRequest request = new ImageRequest(InputName, mStream);
var stopWatch = System.Diagnostics.Stopwatch.StartNew();
try
{
var result = await client.ScoreAsync<float[,]>(request, output_name: OutputName);
var latency = stopWatch.Elapsed;
for (int i = 0; i < result.GetLength(0); i++)
{
Console.WriteLine($"Latency: {latency}");
Console.WriteLine($"Batch {i}:");
var length = result.GetLength(1);
var results = new Dictionary<int, float>();
for (int j = 0; j < length; j++)
{
results.Add(j, result[i, j]);
}
foreach (var kvp in results.Where(x => x.Value > 0.001).OrderByDescending(x => x.Value).Take(5))
{
Console.WriteLine(
$" {GetLabel(kvp.Key)} {kvp.Value * 100}%");
char[] delimiterChars = { ' ', ',' };
foreach (var key in GetLabel(kvp.Key).Split(delimiterChars))
{
if (category.ContainsKey(key))
{
amlResult.Add(true);
// output AML results
string blobName_AML = $@"frame-{frameIndex}-zAML-{key}-{kvp.Value}.jpg";
string fileName_AML = @OutputFolder.OutputFolderAML + blobName_AML;
File.WriteAllBytes(fileName_AML, items[itemIndex].CroppedImageData);
File.WriteAllBytes(@OutputFolder.OutputFolderAll + blobName_AML, items[itemIndex].CroppedImageData);
goto CheckNextItem;
}
}
}
}
}
catch (Exception e)
{
Console.WriteLine("error:" + e);
return null;
}
}
CheckNextItem:;
}
return amlResult;
}
private static Dictionary<int, string> _classes;
private static string GetLabel(int classId)
{
if (_classes == null)
{
var assembly = typeof(AMLCaller).GetTypeInfo().Assembly;
var result = assembly.GetManifestResourceStream("AML.Client.imagenet-classes.json");
var streamReader = new StreamReader(result);
var classesJson = streamReader.ReadToEnd();
_classes = JsonConvert.DeserializeObject<Dictionary<int, string>>(classesJson);
}
return _classes[classId];
}
}
}

Просмотреть файл

@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System.Threading.Tasks;
using Tensorflow.Serving;
namespace AML.Client
{
public interface IPredictionServiceClient
{
Task<PredictResponse> PredictAsync(PredictRequest predictRequest);
}
public class PredictionServiceClientWrapper : IPredictionServiceClient
{
private readonly PredictionService.PredictionServiceClient _predictionServiceClient;
public PredictionServiceClientWrapper(PredictionService.PredictionServiceClient predictionServiceClient)
{
_predictionServiceClient = predictionServiceClient;
}
public Task<PredictResponse> PredictAsync(PredictRequest predictRequest) => _predictionServiceClient.PredictAsync(predictRequest).ResponseAsync;
}
}

Просмотреть файл

@ -0,0 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Tensorflow.Serving;
namespace AML.Client
{
public interface IScoringRequest
{
PredictRequest MakePredictRequest();
}
}

Просмотреть файл

@ -0,0 +1,39 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.IO;
using System.Linq;
using Google.Protobuf;
using Tensorflow;
using Tensorflow.Serving;
using DataType = Tensorflow.DataType;
namespace AML.Client
{
public class ImageRequest : IScoringRequest
{
private readonly ModelSpec _modelSpec;
private readonly TensorProto _proto;
private readonly string _inputName;
public ImageRequest(string inputName, params Stream[] images)
{
_modelSpec = new ModelSpec();
_proto = new TensorProto { Dtype = DataType.DtString };
var bytes = images.Select(ByteString.FromStream);
_proto.StringVal.AddRange(bytes);
_proto.TensorShape = new TensorShapeProto();
_proto.TensorShape.Dim.Add(new TensorShapeProto.Types.Dim());
_proto.TensorShape.Dim[0].Size = images.Length;
_inputName = inputName;
}
public PredictRequest MakePredictRequest()
{
var request = new PredictRequest { ModelSpec = _modelSpec };
request.Inputs[this._inputName] = _proto;
return request;
}
}
}

Просмотреть файл

@ -0,0 +1,108 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Threading.Tasks;
using Grpc.Core;
using Tensorflow.Serving;
using Grpc.Core.Interceptors;
using System.Collections.Generic;
using System.Linq;
namespace AML.Client
{
public class ScoringClient
{
private const int RetryCount = 10;
private readonly IPredictionServiceClient _client;
public ScoringClient(IPredictionServiceClient client)
{
_client = client;
}
public ScoringClient(Channel channel) : this(new PredictionServiceClientWrapper(new PredictionService.PredictionServiceClient(channel)))
{
}
public ScoringClient(string host, int port, bool useSsl = false, string authKey = null, string serviceName = null)
{
ChannelCredentials baseCreds, creds;
baseCreds = useSsl ? new SslCredentials() : ChannelCredentials.Insecure;
if (authKey != null && useSsl)
{
creds = ChannelCredentials.Create(baseCreds, CallCredentials.FromInterceptor(
async (context, metadata) =>
{
metadata.Add(new Metadata.Entry("authorization", authKey));
await Task.CompletedTask;
}));
}
else
{
creds = baseCreds;
}
var channel = new Channel(host, port, creds);
var callInvoker = channel.Intercept(
metadata =>
{
metadata.Add(
new Metadata.Entry("x-ms-aml-grpc-service-route", $"/api/v1/service/{serviceName}"));
return metadata;
});
_client = new PredictionServiceClientWrapper(new PredictionService.PredictionServiceClient(callInvoker));
}
public async Task<float[]> ScoreAsync(IScoringRequest request, int retryCount = RetryCount, string output_name = "output_alias")
{
return await ScoreAsync<float[]>(request, retryCount, output_name);
}
public async Task<T> ScoreAsync<T>(IScoringRequest request, int retryCount = RetryCount, string output_name = "output_alias") where T : class
{
return (await this.PredictAsync<T>(request, retryCount))[output_name];
}
public async Task<Dictionary<string, T>> PredictAsync<T>(IScoringRequest request, int retryCount = RetryCount) where T : class
{
var predictRequest = request.MakePredictRequest();
return await RetryAsync(async () =>
{
var result = await _client.PredictAsync(predictRequest);
return result.Outputs.ToDictionary(
kvp => kvp.Key, kvp => kvp.Value.Convert<T>());
}, retryCount);
}
private async Task<T> RetryAsync<T>(
Func<Task<T>> operation, int retryCount = RetryCount
)
{
while (true)
{
try
{
return await operation();
}
catch (RpcException rpcException)
{
if (!IsTransient(rpcException) || --retryCount <= 0)
{
throw;
}
}
}
}
private static bool IsTransient(RpcException rpcException)
{
return
rpcException.Status.StatusCode == StatusCode.DeadlineExceeded ||
rpcException.Status.StatusCode == StatusCode.Unavailable ||
rpcException.Status.StatusCode == StatusCode.Aborted ||
rpcException.Status.StatusCode == StatusCode.Internal;
}
}
}

Просмотреть файл

@ -0,0 +1,82 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using Tensorflow;
namespace AML.Client
{
public static class TensorExtensions
{
public static T Convert<T>(this TensorProto tensor) where T : class
{
var shape = tensor.TensorShape;
var dimCount = shape.Dim.Count;
var resultType = typeof(T);
if (!resultType.IsArray)
{
throw new Exception("Unable to convert tensor into scalar type");
}
var arrayRank = typeof(T).GetArrayRank();
if (arrayRank != dimCount)
{
throw new Exception($"result tensor was not the expected rank {arrayRank} - was rank {dimCount}");
}
var elementType = resultType.GetElementType();
Func<TensorProto, int, object> getItemFunc = null;
if (elementType == typeof(float))
{
getItemFunc = (t, i) => t.FloatVal[i];
}
if (getItemFunc == null)
{
throw new Exception($"Don't know how to handle type {elementType}");
}
var dimSizes = shape.Dim.Select(d => (int)d.Size).ToArray();
var sysArray = Array.CreateInstance(elementType, dimSizes);
var tensorIndex = 0;
foreach (var dimArray in GetPermutations(dimSizes))
{
sysArray.SetValue(getItemFunc(tensor, tensorIndex), dimArray);
tensorIndex++;
}
return sysArray as T;
}
public static IEnumerable<int[]> GetPermutations(this int[] maxValues)
{
return GetPermutations(new int[maxValues.Length], 0, maxValues);
}
private static IEnumerable<int[]> GetPermutations(int[] values, int index, int[] maxValues)
{
if (index >= values.Length)
{
return new[] { values };
}
var result = new List<int[]>();
for (var i = 0; i < maxValues[index]; i++)
{
var currentValues = values.ToArray();
currentValues[index] = i;
result.AddRange(GetPermutations(currentValues, index + 1, maxValues));
}
return result;
}
}
}

Просмотреть файл

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.10.0" />
<PackageReference Include="Grpc" Version="2.24.0" />
<PackageReference Include="protobuf" Version="2.6.1.1" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,725 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/classification.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Serving {
/// <summary>Holder for reflection information generated from tensorflow_serving/apis/classification.proto</summary>
public static partial class ClassificationReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow_serving/apis/classification.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ClassificationReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cix0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9jbGFzc2lmaWNhdGlvbi5wcm90",
"bxISdGVuc29yZmxvdy5zZXJ2aW5nGiN0ZW5zb3JmbG93X3NlcnZpbmcvYXBp",
"cy9pbnB1dC5wcm90bxojdGVuc29yZmxvd19zZXJ2aW5nL2FwaXMvbW9kZWwu",
"cHJvdG8iJQoFQ2xhc3MSDQoFbGFiZWwYASABKAkSDQoFc2NvcmUYAiABKAIi",
"PQoPQ2xhc3NpZmljYXRpb25zEioKB2NsYXNzZXMYASADKAsyGS50ZW5zb3Jm",
"bG93LnNlcnZpbmcuQ2xhc3MiVAoUQ2xhc3NpZmljYXRpb25SZXN1bHQSPAoP",
"Y2xhc3NpZmljYXRpb25zGAEgAygLMiMudGVuc29yZmxvdy5zZXJ2aW5nLkNs",
"YXNzaWZpY2F0aW9ucyJ0ChVDbGFzc2lmaWNhdGlvblJlcXVlc3QSMQoKbW9k",
"ZWxfc3BlYxgBIAEoCzIdLnRlbnNvcmZsb3cuc2VydmluZy5Nb2RlbFNwZWMS",
"KAoFaW5wdXQYAiABKAsyGS50ZW5zb3JmbG93LnNlcnZpbmcuSW5wdXQiUgoW",
"Q2xhc3NpZmljYXRpb25SZXNwb25zZRI4CgZyZXN1bHQYASABKAsyKC50ZW5z",
"b3JmbG93LnNlcnZpbmcuQ2xhc3NpZmljYXRpb25SZXN1bHRCA/gBAWIGcHJv",
"dG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.Serving.InputReflection.Descriptor, global::Tensorflow.Serving.ModelReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.Class), global::Tensorflow.Serving.Class.Parser, new[]{ "Label", "Score" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.Classifications), global::Tensorflow.Serving.Classifications.Parser, new[]{ "Classes" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.ClassificationResult), global::Tensorflow.Serving.ClassificationResult.Parser, new[]{ "Classifications" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.ClassificationRequest), global::Tensorflow.Serving.ClassificationRequest.Parser, new[]{ "ModelSpec", "Input" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.ClassificationResponse), global::Tensorflow.Serving.ClassificationResponse.Parser, new[]{ "Result" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// A single class.
/// </summary>
public sealed partial class Class : pb::IMessage<Class> {
private static readonly pb::MessageParser<Class> _parser = new pb::MessageParser<Class>(() => new Class());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Class> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.ClassificationReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Class() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Class(Class other) : this() {
label_ = other.label_;
score_ = other.score_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Class Clone() {
return new Class(this);
}
/// <summary>Field number for the "label" field.</summary>
public const int LabelFieldNumber = 1;
private string label_ = "";
/// <summary>
/// Label or name of the class.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Label {
get { return label_; }
set {
label_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "score" field.</summary>
public const int ScoreFieldNumber = 2;
private float score_;
/// <summary>
/// Score for this class (e.g., the probability the item belongs to this
/// class).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float Score {
get { return score_; }
set {
score_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Class);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Class other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Label != other.Label) return false;
if (Score != other.Score) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Label.Length != 0) hash ^= Label.GetHashCode();
if (Score != 0F) hash ^= Score.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Label.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Label);
}
if (Score != 0F) {
output.WriteRawTag(21);
output.WriteFloat(Score);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Label.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Label);
}
if (Score != 0F) {
size += 1 + 4;
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Class other) {
if (other == null) {
return;
}
if (other.Label.Length != 0) {
Label = other.Label;
}
if (other.Score != 0F) {
Score = other.Score;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Label = input.ReadString();
break;
}
case 21: {
Score = input.ReadFloat();
break;
}
}
}
}
}
/// <summary>
/// List of classes for a single item (tensorflow.Example).
/// </summary>
public sealed partial class Classifications : pb::IMessage<Classifications> {
private static readonly pb::MessageParser<Classifications> _parser = new pb::MessageParser<Classifications>(() => new Classifications());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Classifications> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.ClassificationReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Classifications() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Classifications(Classifications other) : this() {
classes_ = other.classes_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Classifications Clone() {
return new Classifications(this);
}
/// <summary>Field number for the "classes" field.</summary>
public const int ClassesFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Serving.Class> _repeated_classes_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Serving.Class.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Serving.Class> classes_ = new pbc::RepeatedField<global::Tensorflow.Serving.Class>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Serving.Class> Classes {
get { return classes_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Classifications);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Classifications other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!classes_.Equals(other.classes_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= classes_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
classes_.WriteTo(output, _repeated_classes_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += classes_.CalculateSize(_repeated_classes_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Classifications other) {
if (other == null) {
return;
}
classes_.Add(other.classes_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
classes_.AddEntriesFrom(input, _repeated_classes_codec);
break;
}
}
}
}
}
/// <summary>
/// Contains one result per input example, in the same order as the input in
/// ClassificationRequest.
/// </summary>
public sealed partial class ClassificationResult : pb::IMessage<ClassificationResult> {
private static readonly pb::MessageParser<ClassificationResult> _parser = new pb::MessageParser<ClassificationResult>(() => new ClassificationResult());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ClassificationResult> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.ClassificationReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClassificationResult() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClassificationResult(ClassificationResult other) : this() {
classifications_ = other.classifications_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClassificationResult Clone() {
return new ClassificationResult(this);
}
/// <summary>Field number for the "classifications" field.</summary>
public const int ClassificationsFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Serving.Classifications> _repeated_classifications_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Serving.Classifications.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Serving.Classifications> classifications_ = new pbc::RepeatedField<global::Tensorflow.Serving.Classifications>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Serving.Classifications> Classifications {
get { return classifications_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ClassificationResult);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ClassificationResult other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!classifications_.Equals(other.classifications_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= classifications_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
classifications_.WriteTo(output, _repeated_classifications_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += classifications_.CalculateSize(_repeated_classifications_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ClassificationResult other) {
if (other == null) {
return;
}
classifications_.Add(other.classifications_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
classifications_.AddEntriesFrom(input, _repeated_classifications_codec);
break;
}
}
}
}
}
public sealed partial class ClassificationRequest : pb::IMessage<ClassificationRequest> {
private static readonly pb::MessageParser<ClassificationRequest> _parser = new pb::MessageParser<ClassificationRequest>(() => new ClassificationRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ClassificationRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.ClassificationReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClassificationRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClassificationRequest(ClassificationRequest other) : this() {
ModelSpec = other.modelSpec_ != null ? other.ModelSpec.Clone() : null;
Input = other.input_ != null ? other.Input.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClassificationRequest Clone() {
return new ClassificationRequest(this);
}
/// <summary>Field number for the "model_spec" field.</summary>
public const int ModelSpecFieldNumber = 1;
private global::Tensorflow.Serving.ModelSpec modelSpec_;
/// <summary>
/// Model Specification.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ModelSpec ModelSpec {
get { return modelSpec_; }
set {
modelSpec_ = value;
}
}
/// <summary>Field number for the "input" field.</summary>
public const int InputFieldNumber = 2;
private global::Tensorflow.Serving.Input input_;
/// <summary>
/// Input data.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.Input Input {
get { return input_; }
set {
input_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ClassificationRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ClassificationRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(ModelSpec, other.ModelSpec)) return false;
if (!object.Equals(Input, other.Input)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (modelSpec_ != null) hash ^= ModelSpec.GetHashCode();
if (input_ != null) hash ^= Input.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (modelSpec_ != null) {
output.WriteRawTag(10);
output.WriteMessage(ModelSpec);
}
if (input_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Input);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (modelSpec_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ModelSpec);
}
if (input_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Input);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ClassificationRequest other) {
if (other == null) {
return;
}
if (other.modelSpec_ != null) {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
ModelSpec.MergeFrom(other.ModelSpec);
}
if (other.input_ != null) {
if (input_ == null) {
input_ = new global::Tensorflow.Serving.Input();
}
Input.MergeFrom(other.Input);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
input.ReadMessage(modelSpec_);
break;
}
case 18: {
if (input_ == null) {
input_ = new global::Tensorflow.Serving.Input();
}
input.ReadMessage(input_);
break;
}
}
}
}
}
public sealed partial class ClassificationResponse : pb::IMessage<ClassificationResponse> {
private static readonly pb::MessageParser<ClassificationResponse> _parser = new pb::MessageParser<ClassificationResponse>(() => new ClassificationResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ClassificationResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.ClassificationReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClassificationResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClassificationResponse(ClassificationResponse other) : this() {
Result = other.result_ != null ? other.Result.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClassificationResponse Clone() {
return new ClassificationResponse(this);
}
/// <summary>Field number for the "result" field.</summary>
public const int ResultFieldNumber = 1;
private global::Tensorflow.Serving.ClassificationResult result_;
/// <summary>
/// Result of the classification.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ClassificationResult Result {
get { return result_; }
set {
result_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ClassificationResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ClassificationResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Result, other.Result)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (result_ != null) hash ^= Result.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (result_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Result);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (result_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Result);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ClassificationResponse other) {
if (other == null) {
return;
}
if (other.result_ != null) {
if (result_ == null) {
result_ = new global::Tensorflow.Serving.ClassificationResult();
}
Result.MergeFrom(other.Result);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (result_ == null) {
result_ = new global::Tensorflow.Serving.ClassificationResult();
}
input.ReadMessage(result_);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,469 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/get_model_metadata.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Serving {
/// <summary>Holder for reflection information generated from tensorflow_serving/apis/get_model_metadata.proto</summary>
public static partial class GetModelMetadataReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow_serving/apis/get_model_metadata.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static GetModelMetadataReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjB0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9nZXRfbW9kZWxfbWV0YWRhdGEu",
"cHJvdG8SEnRlbnNvcmZsb3cuc2VydmluZxoZZ29vZ2xlL3Byb3RvYnVmL2Fu",
"eS5wcm90bxopdGVuc29yZmxvdy9jb3JlL3Byb3RvYnVmL21ldGFfZ3JhcGgu",
"cHJvdG8aI3RlbnNvcmZsb3dfc2VydmluZy9hcGlzL21vZGVsLnByb3RvIq4B",
"Cg9TaWduYXR1cmVEZWZNYXASTAoNc2lnbmF0dXJlX2RlZhgBIAMoCzI1LnRl",
"bnNvcmZsb3cuc2VydmluZy5TaWduYXR1cmVEZWZNYXAuU2lnbmF0dXJlRGVm",
"RW50cnkaTQoRU2lnbmF0dXJlRGVmRW50cnkSCwoDa2V5GAEgASgJEicKBXZh",
"bHVlGAIgASgLMhgudGVuc29yZmxvdy5TaWduYXR1cmVEZWY6AjgBImQKF0dl",
"dE1vZGVsTWV0YWRhdGFSZXF1ZXN0EjEKCm1vZGVsX3NwZWMYASABKAsyHS50",
"ZW5zb3JmbG93LnNlcnZpbmcuTW9kZWxTcGVjEhYKDm1ldGFkYXRhX2ZpZWxk",
"GAIgAygJIuIBChhHZXRNb2RlbE1ldGFkYXRhUmVzcG9uc2USMQoKbW9kZWxf",
"c3BlYxgBIAEoCzIdLnRlbnNvcmZsb3cuc2VydmluZy5Nb2RlbFNwZWMSTAoI",
"bWV0YWRhdGEYAiADKAsyOi50ZW5zb3JmbG93LnNlcnZpbmcuR2V0TW9kZWxN",
"ZXRhZGF0YVJlc3BvbnNlLk1ldGFkYXRhRW50cnkaRQoNTWV0YWRhdGFFbnRy",
"eRILCgNrZXkYASABKAkSIwoFdmFsdWUYAiABKAsyFC5nb29nbGUucHJvdG9i",
"dWYuQW55OgI4AUID+AEBYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Tensorflow.MetaGraphReflection.Descriptor, global::Tensorflow.Serving.ModelReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.SignatureDefMap), global::Tensorflow.Serving.SignatureDefMap.Parser, new[]{ "SignatureDef" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.GetModelMetadataRequest), global::Tensorflow.Serving.GetModelMetadataRequest.Parser, new[]{ "ModelSpec", "MetadataField" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.GetModelMetadataResponse), global::Tensorflow.Serving.GetModelMetadataResponse.Parser, new[]{ "ModelSpec", "Metadata" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
}));
}
#endregion
}
#region Messages
/// <summary>
/// Message returned for "signature_def" field.
/// </summary>
public sealed partial class SignatureDefMap : pb::IMessage<SignatureDefMap> {
private static readonly pb::MessageParser<SignatureDefMap> _parser = new pb::MessageParser<SignatureDefMap>(() => new SignatureDefMap());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SignatureDefMap> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.GetModelMetadataReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SignatureDefMap() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SignatureDefMap(SignatureDefMap other) : this() {
signatureDef_ = other.signatureDef_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SignatureDefMap Clone() {
return new SignatureDefMap(this);
}
/// <summary>Field number for the "signature_def" field.</summary>
public const int SignatureDefFieldNumber = 1;
private static readonly pbc::MapField<string, global::Tensorflow.SignatureDef>.Codec _map_signatureDef_codec
= new pbc::MapField<string, global::Tensorflow.SignatureDef>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Tensorflow.SignatureDef.Parser), 10);
private readonly pbc::MapField<string, global::Tensorflow.SignatureDef> signatureDef_ = new pbc::MapField<string, global::Tensorflow.SignatureDef>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Tensorflow.SignatureDef> SignatureDef {
get { return signatureDef_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SignatureDefMap);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(SignatureDefMap other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!SignatureDef.Equals(other.SignatureDef)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= SignatureDef.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
signatureDef_.WriteTo(output, _map_signatureDef_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += signatureDef_.CalculateSize(_map_signatureDef_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(SignatureDefMap other) {
if (other == null) {
return;
}
signatureDef_.Add(other.signatureDef_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
signatureDef_.AddEntriesFrom(input, _map_signatureDef_codec);
break;
}
}
}
}
}
public sealed partial class GetModelMetadataRequest : pb::IMessage<GetModelMetadataRequest> {
private static readonly pb::MessageParser<GetModelMetadataRequest> _parser = new pb::MessageParser<GetModelMetadataRequest>(() => new GetModelMetadataRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GetModelMetadataRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.GetModelMetadataReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetModelMetadataRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetModelMetadataRequest(GetModelMetadataRequest other) : this() {
ModelSpec = other.modelSpec_ != null ? other.ModelSpec.Clone() : null;
metadataField_ = other.metadataField_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetModelMetadataRequest Clone() {
return new GetModelMetadataRequest(this);
}
/// <summary>Field number for the "model_spec" field.</summary>
public const int ModelSpecFieldNumber = 1;
private global::Tensorflow.Serving.ModelSpec modelSpec_;
/// <summary>
/// Model Specification indicating which model we are querying for metadata.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ModelSpec ModelSpec {
get { return modelSpec_; }
set {
modelSpec_ = value;
}
}
/// <summary>Field number for the "metadata_field" field.</summary>
public const int MetadataFieldFieldNumber = 2;
private static readonly pb::FieldCodec<string> _repeated_metadataField_codec
= pb::FieldCodec.ForString(18);
private readonly pbc::RepeatedField<string> metadataField_ = new pbc::RepeatedField<string>();
/// <summary>
/// Metadata fields to get. Currently supported: "signature_def".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> MetadataField {
get { return metadataField_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GetModelMetadataRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GetModelMetadataRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(ModelSpec, other.ModelSpec)) return false;
if(!metadataField_.Equals(other.metadataField_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (modelSpec_ != null) hash ^= ModelSpec.GetHashCode();
hash ^= metadataField_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (modelSpec_ != null) {
output.WriteRawTag(10);
output.WriteMessage(ModelSpec);
}
metadataField_.WriteTo(output, _repeated_metadataField_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (modelSpec_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ModelSpec);
}
size += metadataField_.CalculateSize(_repeated_metadataField_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GetModelMetadataRequest other) {
if (other == null) {
return;
}
if (other.modelSpec_ != null) {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
ModelSpec.MergeFrom(other.ModelSpec);
}
metadataField_.Add(other.metadataField_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
input.ReadMessage(modelSpec_);
break;
}
case 18: {
metadataField_.AddEntriesFrom(input, _repeated_metadataField_codec);
break;
}
}
}
}
}
public sealed partial class GetModelMetadataResponse : pb::IMessage<GetModelMetadataResponse> {
private static readonly pb::MessageParser<GetModelMetadataResponse> _parser = new pb::MessageParser<GetModelMetadataResponse>(() => new GetModelMetadataResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GetModelMetadataResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.GetModelMetadataReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetModelMetadataResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetModelMetadataResponse(GetModelMetadataResponse other) : this() {
ModelSpec = other.modelSpec_ != null ? other.ModelSpec.Clone() : null;
metadata_ = other.metadata_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetModelMetadataResponse Clone() {
return new GetModelMetadataResponse(this);
}
/// <summary>Field number for the "model_spec" field.</summary>
public const int ModelSpecFieldNumber = 1;
private global::Tensorflow.Serving.ModelSpec modelSpec_;
/// <summary>
/// Model Specification indicating which model this metadata belongs to.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ModelSpec ModelSpec {
get { return modelSpec_; }
set {
modelSpec_ = value;
}
}
/// <summary>Field number for the "metadata" field.</summary>
public const int MetadataFieldNumber = 2;
private static readonly pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Any>.Codec _map_metadata_codec
= new pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Any>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Any.Parser), 18);
private readonly pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Any> metadata_ = new pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Any>();
/// <summary>
/// Map of metadata field name to metadata field. The options for metadata
/// field name are listed in GetModelMetadataRequest. Currently supported:
/// "signature_def".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Any> Metadata {
get { return metadata_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GetModelMetadataResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GetModelMetadataResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(ModelSpec, other.ModelSpec)) return false;
if (!Metadata.Equals(other.Metadata)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (modelSpec_ != null) hash ^= ModelSpec.GetHashCode();
hash ^= Metadata.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (modelSpec_ != null) {
output.WriteRawTag(10);
output.WriteMessage(ModelSpec);
}
metadata_.WriteTo(output, _map_metadata_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (modelSpec_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ModelSpec);
}
size += metadata_.CalculateSize(_map_metadata_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GetModelMetadataResponse other) {
if (other == null) {
return;
}
if (other.modelSpec_ != null) {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
ModelSpec.MergeFrom(other.ModelSpec);
}
metadata_.Add(other.metadata_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
input.ReadMessage(modelSpec_);
break;
}
case 18: {
metadata_.AddEntriesFrom(input, _map_metadata_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,709 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/inference.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Serving {
/// <summary>Holder for reflection information generated from tensorflow_serving/apis/inference.proto</summary>
public static partial class InferenceReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow_serving/apis/inference.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static InferenceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cid0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9pbmZlcmVuY2UucHJvdG8SEnRl",
"bnNvcmZsb3cuc2VydmluZxosdGVuc29yZmxvd19zZXJ2aW5nL2FwaXMvY2xh",
"c3NpZmljYXRpb24ucHJvdG8aI3RlbnNvcmZsb3dfc2VydmluZy9hcGlzL2lu",
"cHV0LnByb3RvGiN0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9tb2RlbC5wcm90",
"bxoodGVuc29yZmxvd19zZXJ2aW5nL2FwaXMvcmVncmVzc2lvbi5wcm90byJX",
"Cg1JbmZlcmVuY2VUYXNrEjEKCm1vZGVsX3NwZWMYASABKAsyHS50ZW5zb3Jm",
"bG93LnNlcnZpbmcuTW9kZWxTcGVjEhMKC21ldGhvZF9uYW1lGAIgASgJItwB",
"Cg9JbmZlcmVuY2VSZXN1bHQSMQoKbW9kZWxfc3BlYxgBIAEoCzIdLnRlbnNv",
"cmZsb3cuc2VydmluZy5Nb2RlbFNwZWMSSQoVY2xhc3NpZmljYXRpb25fcmVz",
"dWx0GAIgASgLMigudGVuc29yZmxvdy5zZXJ2aW5nLkNsYXNzaWZpY2F0aW9u",
"UmVzdWx0SAASQQoRcmVncmVzc2lvbl9yZXN1bHQYAyABKAsyJC50ZW5zb3Jm",
"bG93LnNlcnZpbmcuUmVncmVzc2lvblJlc3VsdEgAQggKBnJlc3VsdCJzChVN",
"dWx0aUluZmVyZW5jZVJlcXVlc3QSMAoFdGFza3MYASADKAsyIS50ZW5zb3Jm",
"bG93LnNlcnZpbmcuSW5mZXJlbmNlVGFzaxIoCgVpbnB1dBgCIAEoCzIZLnRl",
"bnNvcmZsb3cuc2VydmluZy5JbnB1dCJOChZNdWx0aUluZmVyZW5jZVJlc3Bv",
"bnNlEjQKB3Jlc3VsdHMYASADKAsyIy50ZW5zb3JmbG93LnNlcnZpbmcuSW5m",
"ZXJlbmNlUmVzdWx0QgP4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.Serving.ClassificationReflection.Descriptor, global::Tensorflow.Serving.InputReflection.Descriptor, global::Tensorflow.Serving.ModelReflection.Descriptor, global::Tensorflow.Serving.RegressionReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.InferenceTask), global::Tensorflow.Serving.InferenceTask.Parser, new[]{ "ModelSpec", "MethodName" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.InferenceResult), global::Tensorflow.Serving.InferenceResult.Parser, new[]{ "ModelSpec", "ClassificationResult", "RegressionResult" }, new[]{ "Result" }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.MultiInferenceRequest), global::Tensorflow.Serving.MultiInferenceRequest.Parser, new[]{ "Tasks", "Input" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.MultiInferenceResponse), global::Tensorflow.Serving.MultiInferenceResponse.Parser, new[]{ "Results" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Inference request such as classification, regression, etc...
/// </summary>
public sealed partial class InferenceTask : pb::IMessage<InferenceTask> {
private static readonly pb::MessageParser<InferenceTask> _parser = new pb::MessageParser<InferenceTask>(() => new InferenceTask());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<InferenceTask> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.InferenceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public InferenceTask() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public InferenceTask(InferenceTask other) : this() {
ModelSpec = other.modelSpec_ != null ? other.ModelSpec.Clone() : null;
methodName_ = other.methodName_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public InferenceTask Clone() {
return new InferenceTask(this);
}
/// <summary>Field number for the "model_spec" field.</summary>
public const int ModelSpecFieldNumber = 1;
private global::Tensorflow.Serving.ModelSpec modelSpec_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ModelSpec ModelSpec {
get { return modelSpec_; }
set {
modelSpec_ = value;
}
}
/// <summary>Field number for the "method_name" field.</summary>
public const int MethodNameFieldNumber = 2;
private string methodName_ = "";
/// <summary>
/// Signature's method_name. Should be one of the method names defined in
/// third_party/tensorflow/python/saved_model/signature_constants.py.
/// e.g. "tensorflow/serving/classify".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string MethodName {
get { return methodName_; }
set {
methodName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as InferenceTask);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(InferenceTask other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(ModelSpec, other.ModelSpec)) return false;
if (MethodName != other.MethodName) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (modelSpec_ != null) hash ^= ModelSpec.GetHashCode();
if (MethodName.Length != 0) hash ^= MethodName.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (modelSpec_ != null) {
output.WriteRawTag(10);
output.WriteMessage(ModelSpec);
}
if (MethodName.Length != 0) {
output.WriteRawTag(18);
output.WriteString(MethodName);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (modelSpec_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ModelSpec);
}
if (MethodName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(MethodName);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(InferenceTask other) {
if (other == null) {
return;
}
if (other.modelSpec_ != null) {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
ModelSpec.MergeFrom(other.ModelSpec);
}
if (other.MethodName.Length != 0) {
MethodName = other.MethodName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
input.ReadMessage(modelSpec_);
break;
}
case 18: {
MethodName = input.ReadString();
break;
}
}
}
}
}
/// <summary>
/// Inference result, matches the type of request or is an error.
/// </summary>
public sealed partial class InferenceResult : pb::IMessage<InferenceResult> {
private static readonly pb::MessageParser<InferenceResult> _parser = new pb::MessageParser<InferenceResult>(() => new InferenceResult());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<InferenceResult> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.InferenceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public InferenceResult() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public InferenceResult(InferenceResult other) : this() {
ModelSpec = other.modelSpec_ != null ? other.ModelSpec.Clone() : null;
switch (other.ResultCase) {
case ResultOneofCase.ClassificationResult:
ClassificationResult = other.ClassificationResult.Clone();
break;
case ResultOneofCase.RegressionResult:
RegressionResult = other.RegressionResult.Clone();
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public InferenceResult Clone() {
return new InferenceResult(this);
}
/// <summary>Field number for the "model_spec" field.</summary>
public const int ModelSpecFieldNumber = 1;
private global::Tensorflow.Serving.ModelSpec modelSpec_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ModelSpec ModelSpec {
get { return modelSpec_; }
set {
modelSpec_ = value;
}
}
/// <summary>Field number for the "classification_result" field.</summary>
public const int ClassificationResultFieldNumber = 2;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ClassificationResult ClassificationResult {
get { return resultCase_ == ResultOneofCase.ClassificationResult ? (global::Tensorflow.Serving.ClassificationResult) result_ : null; }
set {
result_ = value;
resultCase_ = value == null ? ResultOneofCase.None : ResultOneofCase.ClassificationResult;
}
}
/// <summary>Field number for the "regression_result" field.</summary>
public const int RegressionResultFieldNumber = 3;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.RegressionResult RegressionResult {
get { return resultCase_ == ResultOneofCase.RegressionResult ? (global::Tensorflow.Serving.RegressionResult) result_ : null; }
set {
result_ = value;
resultCase_ = value == null ? ResultOneofCase.None : ResultOneofCase.RegressionResult;
}
}
private object result_;
/// <summary>Enum of possible cases for the "result" oneof.</summary>
public enum ResultOneofCase {
None = 0,
ClassificationResult = 2,
RegressionResult = 3,
}
private ResultOneofCase resultCase_ = ResultOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ResultOneofCase ResultCase {
get { return resultCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearResult() {
resultCase_ = ResultOneofCase.None;
result_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as InferenceResult);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(InferenceResult other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(ModelSpec, other.ModelSpec)) return false;
if (!object.Equals(ClassificationResult, other.ClassificationResult)) return false;
if (!object.Equals(RegressionResult, other.RegressionResult)) return false;
if (ResultCase != other.ResultCase) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (modelSpec_ != null) hash ^= ModelSpec.GetHashCode();
if (resultCase_ == ResultOneofCase.ClassificationResult) hash ^= ClassificationResult.GetHashCode();
if (resultCase_ == ResultOneofCase.RegressionResult) hash ^= RegressionResult.GetHashCode();
hash ^= (int) resultCase_;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (modelSpec_ != null) {
output.WriteRawTag(10);
output.WriteMessage(ModelSpec);
}
if (resultCase_ == ResultOneofCase.ClassificationResult) {
output.WriteRawTag(18);
output.WriteMessage(ClassificationResult);
}
if (resultCase_ == ResultOneofCase.RegressionResult) {
output.WriteRawTag(26);
output.WriteMessage(RegressionResult);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (modelSpec_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ModelSpec);
}
if (resultCase_ == ResultOneofCase.ClassificationResult) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClassificationResult);
}
if (resultCase_ == ResultOneofCase.RegressionResult) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegressionResult);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(InferenceResult other) {
if (other == null) {
return;
}
if (other.modelSpec_ != null) {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
ModelSpec.MergeFrom(other.ModelSpec);
}
switch (other.ResultCase) {
case ResultOneofCase.ClassificationResult:
ClassificationResult = other.ClassificationResult;
break;
case ResultOneofCase.RegressionResult:
RegressionResult = other.RegressionResult;
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
input.ReadMessage(modelSpec_);
break;
}
case 18: {
global::Tensorflow.Serving.ClassificationResult subBuilder = new global::Tensorflow.Serving.ClassificationResult();
if (resultCase_ == ResultOneofCase.ClassificationResult) {
subBuilder.MergeFrom(ClassificationResult);
}
input.ReadMessage(subBuilder);
ClassificationResult = subBuilder;
break;
}
case 26: {
global::Tensorflow.Serving.RegressionResult subBuilder = new global::Tensorflow.Serving.RegressionResult();
if (resultCase_ == ResultOneofCase.RegressionResult) {
subBuilder.MergeFrom(RegressionResult);
}
input.ReadMessage(subBuilder);
RegressionResult = subBuilder;
break;
}
}
}
}
}
/// <summary>
/// Inference request containing one or more requests.
/// </summary>
public sealed partial class MultiInferenceRequest : pb::IMessage<MultiInferenceRequest> {
private static readonly pb::MessageParser<MultiInferenceRequest> _parser = new pb::MessageParser<MultiInferenceRequest>(() => new MultiInferenceRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MultiInferenceRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.InferenceReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MultiInferenceRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MultiInferenceRequest(MultiInferenceRequest other) : this() {
tasks_ = other.tasks_.Clone();
Input = other.input_ != null ? other.Input.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MultiInferenceRequest Clone() {
return new MultiInferenceRequest(this);
}
/// <summary>Field number for the "tasks" field.</summary>
public const int TasksFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Serving.InferenceTask> _repeated_tasks_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Serving.InferenceTask.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Serving.InferenceTask> tasks_ = new pbc::RepeatedField<global::Tensorflow.Serving.InferenceTask>();
/// <summary>
/// Inference tasks.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Serving.InferenceTask> Tasks {
get { return tasks_; }
}
/// <summary>Field number for the "input" field.</summary>
public const int InputFieldNumber = 2;
private global::Tensorflow.Serving.Input input_;
/// <summary>
/// Input data.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.Input Input {
get { return input_; }
set {
input_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as MultiInferenceRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(MultiInferenceRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!tasks_.Equals(other.tasks_)) return false;
if (!object.Equals(Input, other.Input)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= tasks_.GetHashCode();
if (input_ != null) hash ^= Input.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
tasks_.WriteTo(output, _repeated_tasks_codec);
if (input_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Input);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += tasks_.CalculateSize(_repeated_tasks_codec);
if (input_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Input);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(MultiInferenceRequest other) {
if (other == null) {
return;
}
tasks_.Add(other.tasks_);
if (other.input_ != null) {
if (input_ == null) {
input_ = new global::Tensorflow.Serving.Input();
}
Input.MergeFrom(other.Input);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
tasks_.AddEntriesFrom(input, _repeated_tasks_codec);
break;
}
case 18: {
if (input_ == null) {
input_ = new global::Tensorflow.Serving.Input();
}
input.ReadMessage(input_);
break;
}
}
}
}
}
/// <summary>
/// Inference request containing one or more responses.
/// </summary>
public sealed partial class MultiInferenceResponse : pb::IMessage<MultiInferenceResponse> {
private static readonly pb::MessageParser<MultiInferenceResponse> _parser = new pb::MessageParser<MultiInferenceResponse>(() => new MultiInferenceResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MultiInferenceResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.InferenceReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MultiInferenceResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MultiInferenceResponse(MultiInferenceResponse other) : this() {
results_ = other.results_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MultiInferenceResponse Clone() {
return new MultiInferenceResponse(this);
}
/// <summary>Field number for the "results" field.</summary>
public const int ResultsFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Serving.InferenceResult> _repeated_results_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Serving.InferenceResult.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Serving.InferenceResult> results_ = new pbc::RepeatedField<global::Tensorflow.Serving.InferenceResult>();
/// <summary>
/// List of results; one for each InferenceTask in the request, returned in the
/// same order as the request.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Serving.InferenceResult> Results {
get { return results_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as MultiInferenceResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(MultiInferenceResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!results_.Equals(other.results_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= results_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
results_.WriteTo(output, _repeated_results_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += results_.CalculateSize(_repeated_results_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(MultiInferenceResponse other) {
if (other == null) {
return;
}
results_.Add(other.results_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
results_.AddEntriesFrom(input, _repeated_results_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,543 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/input.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Serving {
/// <summary>Holder for reflection information generated from tensorflow_serving/apis/input.proto</summary>
public static partial class InputReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow_serving/apis/input.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static InputReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiN0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9pbnB1dC5wcm90bxISdGVuc29y",
"Zmxvdy5zZXJ2aW5nGiV0ZW5zb3JmbG93L2NvcmUvZXhhbXBsZS9leGFtcGxl",
"LnByb3RvIjQKC0V4YW1wbGVMaXN0EiUKCGV4YW1wbGVzGAEgAygLMhMudGVu",
"c29yZmxvdy5FeGFtcGxlImUKFkV4YW1wbGVMaXN0V2l0aENvbnRleHQSJQoI",
"ZXhhbXBsZXMYASADKAsyEy50ZW5zb3JmbG93LkV4YW1wbGUSJAoHY29udGV4",
"dBgCIAEoCzITLnRlbnNvcmZsb3cuRXhhbXBsZSKhAQoFSW5wdXQSOwoMZXhh",
"bXBsZV9saXN0GAEgASgLMh8udGVuc29yZmxvdy5zZXJ2aW5nLkV4YW1wbGVM",
"aXN0QgIoAUgAElMKGWV4YW1wbGVfbGlzdF93aXRoX2NvbnRleHQYAiABKAsy",
"Ki50ZW5zb3JmbG93LnNlcnZpbmcuRXhhbXBsZUxpc3RXaXRoQ29udGV4dEIC",
"KAFIAEIGCgRraW5kQgP4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.ExampleReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.ExampleList), global::Tensorflow.Serving.ExampleList.Parser, new[]{ "Examples" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.ExampleListWithContext), global::Tensorflow.Serving.ExampleListWithContext.Parser, new[]{ "Examples", "Context" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.Input), global::Tensorflow.Serving.Input.Parser, new[]{ "ExampleList", "ExampleListWithContext" }, new[]{ "Kind" }, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Specifies one or more fully independent input Examples.
/// See examples at:
/// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/example/example.proto
/// </summary>
public sealed partial class ExampleList : pb::IMessage<ExampleList> {
private static readonly pb::MessageParser<ExampleList> _parser = new pb::MessageParser<ExampleList>(() => new ExampleList());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ExampleList> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.InputReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ExampleList() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ExampleList(ExampleList other) : this() {
examples_ = other.examples_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ExampleList Clone() {
return new ExampleList(this);
}
/// <summary>Field number for the "examples" field.</summary>
public const int ExamplesFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Example> _repeated_examples_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Example.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Example> examples_ = new pbc::RepeatedField<global::Tensorflow.Example>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Example> Examples {
get { return examples_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ExampleList);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ExampleList other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!examples_.Equals(other.examples_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= examples_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
examples_.WriteTo(output, _repeated_examples_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += examples_.CalculateSize(_repeated_examples_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ExampleList other) {
if (other == null) {
return;
}
examples_.Add(other.examples_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
examples_.AddEntriesFrom(input, _repeated_examples_codec);
break;
}
}
}
}
}
/// <summary>
/// Specifies one or more independent input Examples, with a common context
/// Example.
///
/// The common use case for context is to cleanly and optimally specify some
/// features that are common across multiple examples.
///
/// See example below with a search query as the context and multiple restaurants
/// to perform some inference on.
///
/// context: {
/// feature: {
/// key : "query"
/// value: {
/// bytes_list: {
/// value: [ "pizza" ]
/// }
/// }
/// }
/// }
/// examples: {
/// feature: {
/// key : "cuisine"
/// value: {
/// bytes_list: {
/// value: [ "Pizzeria" ]
/// }
/// }
/// }
/// }
/// examples: {
/// feature: {
/// key : "cuisine"
/// value: {
/// bytes_list: {
/// value: [ "Taqueria" ]
/// }
/// }
/// }
/// }
///
/// Implementations of ExampleListWithContext merge the context Example into each
/// of the Examples. Note that feature keys must not be duplicated between the
/// Examples and context Example, or the behavior is undefined.
///
/// See also:
/// tensorflow/core/example/example.proto
/// https://developers.google.com/protocol-buffers/docs/proto3#maps
/// </summary>
public sealed partial class ExampleListWithContext : pb::IMessage<ExampleListWithContext> {
private static readonly pb::MessageParser<ExampleListWithContext> _parser = new pb::MessageParser<ExampleListWithContext>(() => new ExampleListWithContext());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ExampleListWithContext> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.InputReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ExampleListWithContext() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ExampleListWithContext(ExampleListWithContext other) : this() {
examples_ = other.examples_.Clone();
Context = other.context_ != null ? other.Context.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ExampleListWithContext Clone() {
return new ExampleListWithContext(this);
}
/// <summary>Field number for the "examples" field.</summary>
public const int ExamplesFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Example> _repeated_examples_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Example.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Example> examples_ = new pbc::RepeatedField<global::Tensorflow.Example>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Example> Examples {
get { return examples_; }
}
/// <summary>Field number for the "context" field.</summary>
public const int ContextFieldNumber = 2;
private global::Tensorflow.Example context_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Example Context {
get { return context_; }
set {
context_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ExampleListWithContext);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ExampleListWithContext other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!examples_.Equals(other.examples_)) return false;
if (!object.Equals(Context, other.Context)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= examples_.GetHashCode();
if (context_ != null) hash ^= Context.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
examples_.WriteTo(output, _repeated_examples_codec);
if (context_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Context);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += examples_.CalculateSize(_repeated_examples_codec);
if (context_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Context);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ExampleListWithContext other) {
if (other == null) {
return;
}
examples_.Add(other.examples_);
if (other.context_ != null) {
if (context_ == null) {
context_ = new global::Tensorflow.Example();
}
Context.MergeFrom(other.Context);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
examples_.AddEntriesFrom(input, _repeated_examples_codec);
break;
}
case 18: {
if (context_ == null) {
context_ = new global::Tensorflow.Example();
}
input.ReadMessage(context_);
break;
}
}
}
}
}
public sealed partial class Input : pb::IMessage<Input> {
private static readonly pb::MessageParser<Input> _parser = new pb::MessageParser<Input>(() => new Input());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Input> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.InputReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Input() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Input(Input other) : this() {
switch (other.KindCase) {
case KindOneofCase.ExampleList:
ExampleList = other.ExampleList.Clone();
break;
case KindOneofCase.ExampleListWithContext:
ExampleListWithContext = other.ExampleListWithContext.Clone();
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Input Clone() {
return new Input(this);
}
/// <summary>Field number for the "example_list" field.</summary>
public const int ExampleListFieldNumber = 1;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ExampleList ExampleList {
get { return kindCase_ == KindOneofCase.ExampleList ? (global::Tensorflow.Serving.ExampleList) kind_ : null; }
set {
kind_ = value;
kindCase_ = value == null ? KindOneofCase.None : KindOneofCase.ExampleList;
}
}
/// <summary>Field number for the "example_list_with_context" field.</summary>
public const int ExampleListWithContextFieldNumber = 2;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ExampleListWithContext ExampleListWithContext {
get { return kindCase_ == KindOneofCase.ExampleListWithContext ? (global::Tensorflow.Serving.ExampleListWithContext) kind_ : null; }
set {
kind_ = value;
kindCase_ = value == null ? KindOneofCase.None : KindOneofCase.ExampleListWithContext;
}
}
private object kind_;
/// <summary>Enum of possible cases for the "kind" oneof.</summary>
public enum KindOneofCase {
None = 0,
ExampleList = 1,
ExampleListWithContext = 2,
}
private KindOneofCase kindCase_ = KindOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public KindOneofCase KindCase {
get { return kindCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearKind() {
kindCase_ = KindOneofCase.None;
kind_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Input);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Input other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(ExampleList, other.ExampleList)) return false;
if (!object.Equals(ExampleListWithContext, other.ExampleListWithContext)) return false;
if (KindCase != other.KindCase) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (kindCase_ == KindOneofCase.ExampleList) hash ^= ExampleList.GetHashCode();
if (kindCase_ == KindOneofCase.ExampleListWithContext) hash ^= ExampleListWithContext.GetHashCode();
hash ^= (int) kindCase_;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (kindCase_ == KindOneofCase.ExampleList) {
output.WriteRawTag(10);
output.WriteMessage(ExampleList);
}
if (kindCase_ == KindOneofCase.ExampleListWithContext) {
output.WriteRawTag(18);
output.WriteMessage(ExampleListWithContext);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (kindCase_ == KindOneofCase.ExampleList) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExampleList);
}
if (kindCase_ == KindOneofCase.ExampleListWithContext) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExampleListWithContext);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Input other) {
if (other == null) {
return;
}
switch (other.KindCase) {
case KindOneofCase.ExampleList:
ExampleList = other.ExampleList;
break;
case KindOneofCase.ExampleListWithContext:
ExampleListWithContext = other.ExampleListWithContext;
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
global::Tensorflow.Serving.ExampleList subBuilder = new global::Tensorflow.Serving.ExampleList();
if (kindCase_ == KindOneofCase.ExampleList) {
subBuilder.MergeFrom(ExampleList);
}
input.ReadMessage(subBuilder);
ExampleList = subBuilder;
break;
}
case 18: {
global::Tensorflow.Serving.ExampleListWithContext subBuilder = new global::Tensorflow.Serving.ExampleListWithContext();
if (kindCase_ == KindOneofCase.ExampleListWithContext) {
subBuilder.MergeFrom(ExampleListWithContext);
}
input.ReadMessage(subBuilder);
ExampleListWithContext = subBuilder;
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2016, The TensorFlow Serving Authors.
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.

Просмотреть файл

@ -0,0 +1,238 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/model.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Serving {
/// <summary>Holder for reflection information generated from tensorflow_serving/apis/model.proto</summary>
public static partial class ModelReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow_serving/apis/model.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ModelReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiN0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9tb2RlbC5wcm90bxISdGVuc29y",
"Zmxvdy5zZXJ2aW5nGh5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8i",
"XwoJTW9kZWxTcGVjEgwKBG5hbWUYASABKAkSLAoHdmVyc2lvbhgCIAEoCzIb",
"Lmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlEhYKDnNpZ25hdHVyZV9uYW1l",
"GAMgASgJQgP4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.ModelSpec), global::Tensorflow.Serving.ModelSpec.Parser, new[]{ "Name", "Version", "SignatureName" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Metadata for an inference request such as the model name and version.
/// </summary>
public sealed partial class ModelSpec : pb::IMessage<ModelSpec> {
private static readonly pb::MessageParser<ModelSpec> _parser = new pb::MessageParser<ModelSpec>(() => new ModelSpec());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ModelSpec> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.ModelReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ModelSpec() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ModelSpec(ModelSpec other) : this() {
name_ = other.name_;
Version = other.Version;
signatureName_ = other.signatureName_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ModelSpec Clone() {
return new ModelSpec(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Required servable name.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "version" field.</summary>
public const int VersionFieldNumber = 2;
private static readonly pb::FieldCodec<long?> _single_version_codec = pb::FieldCodec.ForStructWrapper<long>(18);
private long? version_;
/// <summary>
/// Optional version. If unspecified, will use the latest (numerical) version.
/// Typically not needed unless coordinating across multiple models that were
/// co-trained and/or have inter-dependencies on the versions used at inference
/// time.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long? Version {
get { return version_; }
set {
version_ = value;
}
}
/// <summary>Field number for the "signature_name" field.</summary>
public const int SignatureNameFieldNumber = 3;
private string signatureName_ = "";
/// <summary>
/// A named signature to evaluate. If unspecified, the default signature will
/// be used.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string SignatureName {
get { return signatureName_; }
set {
signatureName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ModelSpec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ModelSpec other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (Version != other.Version) return false;
if (SignatureName != other.SignatureName) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (version_ != null) hash ^= Version.GetHashCode();
if (SignatureName.Length != 0) hash ^= SignatureName.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (version_ != null) {
_single_version_codec.WriteTagAndValue(output, Version);
}
if (SignatureName.Length != 0) {
output.WriteRawTag(26);
output.WriteString(SignatureName);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (version_ != null) {
size += _single_version_codec.CalculateSizeWithTag(Version);
}
if (SignatureName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(SignatureName);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ModelSpec other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.version_ != null) {
if (version_ == null || other.Version != 0L) {
Version = other.Version;
}
}
if (other.SignatureName.Length != 0) {
SignatureName = other.SignatureName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
long? value = _single_version_codec.Read(input);
if (version_ == null || value != 0L) {
Version = value;
}
break;
}
case 26: {
SignatureName = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,353 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/predict.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Serving {
/// <summary>Holder for reflection information generated from tensorflow_serving/apis/predict.proto</summary>
public static partial class PredictReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow_serving/apis/predict.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static PredictReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiV0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9wcmVkaWN0LnByb3RvEhJ0ZW5z",
"b3JmbG93LnNlcnZpbmcaJnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVu",
"c29yLnByb3RvGiN0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9tb2RlbC5wcm90",
"byLiAQoOUHJlZGljdFJlcXVlc3QSMQoKbW9kZWxfc3BlYxgBIAEoCzIdLnRl",
"bnNvcmZsb3cuc2VydmluZy5Nb2RlbFNwZWMSPgoGaW5wdXRzGAIgAygLMi4u",
"dGVuc29yZmxvdy5zZXJ2aW5nLlByZWRpY3RSZXF1ZXN0LklucHV0c0VudHJ5",
"EhUKDW91dHB1dF9maWx0ZXIYAyADKAkaRgoLSW5wdXRzRW50cnkSCwoDa2V5",
"GAEgASgJEiYKBXZhbHVlGAIgASgLMhcudGVuc29yZmxvdy5UZW5zb3JQcm90",
"bzoCOAEinQEKD1ByZWRpY3RSZXNwb25zZRJBCgdvdXRwdXRzGAEgAygLMjAu",
"dGVuc29yZmxvdy5zZXJ2aW5nLlByZWRpY3RSZXNwb25zZS5PdXRwdXRzRW50",
"cnkaRwoMT3V0cHV0c0VudHJ5EgsKA2tleRgBIAEoCRImCgV2YWx1ZRgCIAEo",
"CzIXLnRlbnNvcmZsb3cuVGVuc29yUHJvdG86AjgBQgP4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.TensorReflection.Descriptor, global::Tensorflow.Serving.ModelReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.PredictRequest), global::Tensorflow.Serving.PredictRequest.Parser, new[]{ "ModelSpec", "Inputs", "OutputFilter" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.PredictResponse), global::Tensorflow.Serving.PredictResponse.Parser, new[]{ "Outputs" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
}));
}
#endregion
}
#region Messages
/// <summary>
/// PredictRequest specifies which TensorFlow model to run, as well as
/// how inputs are mapped to tensors and how outputs are filtered before
/// returning to user.
/// </summary>
public sealed partial class PredictRequest : pb::IMessage<PredictRequest> {
private static readonly pb::MessageParser<PredictRequest> _parser = new pb::MessageParser<PredictRequest>(() => new PredictRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<PredictRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.PredictReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PredictRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PredictRequest(PredictRequest other) : this() {
ModelSpec = other.modelSpec_ != null ? other.ModelSpec.Clone() : null;
inputs_ = other.inputs_.Clone();
outputFilter_ = other.outputFilter_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PredictRequest Clone() {
return new PredictRequest(this);
}
/// <summary>Field number for the "model_spec" field.</summary>
public const int ModelSpecFieldNumber = 1;
private global::Tensorflow.Serving.ModelSpec modelSpec_;
/// <summary>
/// Model Specification.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ModelSpec ModelSpec {
get { return modelSpec_; }
set {
modelSpec_ = value;
}
}
/// <summary>Field number for the "inputs" field.</summary>
public const int InputsFieldNumber = 2;
private static readonly pbc::MapField<string, global::Tensorflow.TensorProto>.Codec _map_inputs_codec
= new pbc::MapField<string, global::Tensorflow.TensorProto>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Tensorflow.TensorProto.Parser), 18);
private readonly pbc::MapField<string, global::Tensorflow.TensorProto> inputs_ = new pbc::MapField<string, global::Tensorflow.TensorProto>();
/// <summary>
/// Input tensors.
/// Names of input tensor are alias names. The mapping from aliases to real
/// input tensor names is stored in the SavedModel export as a prediction
/// SignatureDef under the 'inputs' field.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Tensorflow.TensorProto> Inputs {
get { return inputs_; }
}
/// <summary>Field number for the "output_filter" field.</summary>
public const int OutputFilterFieldNumber = 3;
private static readonly pb::FieldCodec<string> _repeated_outputFilter_codec
= pb::FieldCodec.ForString(26);
private readonly pbc::RepeatedField<string> outputFilter_ = new pbc::RepeatedField<string>();
/// <summary>
/// Output filter.
/// Names specified are alias names. The mapping from aliases to real output
/// tensor names is stored in the SavedModel export as a prediction
/// SignatureDef under the 'outputs' field.
/// Only tensors specified here will be run/fetched and returned, with the
/// exception that when none is specified, all tensors specified in the
/// named signature will be run/fetched and returned.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> OutputFilter {
get { return outputFilter_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as PredictRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(PredictRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(ModelSpec, other.ModelSpec)) return false;
if (!Inputs.Equals(other.Inputs)) return false;
if(!outputFilter_.Equals(other.outputFilter_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (modelSpec_ != null) hash ^= ModelSpec.GetHashCode();
hash ^= Inputs.GetHashCode();
hash ^= outputFilter_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (modelSpec_ != null) {
output.WriteRawTag(10);
output.WriteMessage(ModelSpec);
}
inputs_.WriteTo(output, _map_inputs_codec);
outputFilter_.WriteTo(output, _repeated_outputFilter_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (modelSpec_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ModelSpec);
}
size += inputs_.CalculateSize(_map_inputs_codec);
size += outputFilter_.CalculateSize(_repeated_outputFilter_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(PredictRequest other) {
if (other == null) {
return;
}
if (other.modelSpec_ != null) {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
ModelSpec.MergeFrom(other.ModelSpec);
}
inputs_.Add(other.inputs_);
outputFilter_.Add(other.outputFilter_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
input.ReadMessage(modelSpec_);
break;
}
case 18: {
inputs_.AddEntriesFrom(input, _map_inputs_codec);
break;
}
case 26: {
outputFilter_.AddEntriesFrom(input, _repeated_outputFilter_codec);
break;
}
}
}
}
}
/// <summary>
/// Response for PredictRequest on successful run.
/// </summary>
public sealed partial class PredictResponse : pb::IMessage<PredictResponse> {
private static readonly pb::MessageParser<PredictResponse> _parser = new pb::MessageParser<PredictResponse>(() => new PredictResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<PredictResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.PredictReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PredictResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PredictResponse(PredictResponse other) : this() {
outputs_ = other.outputs_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PredictResponse Clone() {
return new PredictResponse(this);
}
/// <summary>Field number for the "outputs" field.</summary>
public const int OutputsFieldNumber = 1;
private static readonly pbc::MapField<string, global::Tensorflow.TensorProto>.Codec _map_outputs_codec
= new pbc::MapField<string, global::Tensorflow.TensorProto>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Tensorflow.TensorProto.Parser), 10);
private readonly pbc::MapField<string, global::Tensorflow.TensorProto> outputs_ = new pbc::MapField<string, global::Tensorflow.TensorProto>();
/// <summary>
/// Output tensors.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Tensorflow.TensorProto> Outputs {
get { return outputs_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as PredictResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(PredictResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!Outputs.Equals(other.Outputs)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= Outputs.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
outputs_.WriteTo(output, _map_outputs_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += outputs_.CalculateSize(_map_outputs_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(PredictResponse other) {
if (other == null) {
return;
}
outputs_.Add(other.outputs_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
outputs_.AddEntriesFrom(input, _map_outputs_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,53 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/prediction_service.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Serving {
/// <summary>Holder for reflection information generated from tensorflow_serving/apis/prediction_service.proto</summary>
public static partial class PredictionServiceReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow_serving/apis/prediction_service.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static PredictionServiceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjB0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9wcmVkaWN0aW9uX3NlcnZpY2Uu",
"cHJvdG8SEnRlbnNvcmZsb3cuc2VydmluZxosdGVuc29yZmxvd19zZXJ2aW5n",
"L2FwaXMvY2xhc3NpZmljYXRpb24ucHJvdG8aMHRlbnNvcmZsb3dfc2Vydmlu",
"Zy9hcGlzL2dldF9tb2RlbF9tZXRhZGF0YS5wcm90bxondGVuc29yZmxvd19z",
"ZXJ2aW5nL2FwaXMvaW5mZXJlbmNlLnByb3RvGiV0ZW5zb3JmbG93X3NlcnZp",
"bmcvYXBpcy9wcmVkaWN0LnByb3RvGih0ZW5zb3JmbG93X3NlcnZpbmcvYXBp",
"cy9yZWdyZXNzaW9uLnByb3RvMvwDChFQcmVkaWN0aW9uU2VydmljZRJhCghD",
"bGFzc2lmeRIpLnRlbnNvcmZsb3cuc2VydmluZy5DbGFzc2lmaWNhdGlvblJl",
"cXVlc3QaKi50ZW5zb3JmbG93LnNlcnZpbmcuQ2xhc3NpZmljYXRpb25SZXNw",
"b25zZRJYCgdSZWdyZXNzEiUudGVuc29yZmxvdy5zZXJ2aW5nLlJlZ3Jlc3Np",
"b25SZXF1ZXN0GiYudGVuc29yZmxvdy5zZXJ2aW5nLlJlZ3Jlc3Npb25SZXNw",
"b25zZRJSCgdQcmVkaWN0EiIudGVuc29yZmxvdy5zZXJ2aW5nLlByZWRpY3RS",
"ZXF1ZXN0GiMudGVuc29yZmxvdy5zZXJ2aW5nLlByZWRpY3RSZXNwb25zZRJn",
"Cg5NdWx0aUluZmVyZW5jZRIpLnRlbnNvcmZsb3cuc2VydmluZy5NdWx0aUlu",
"ZmVyZW5jZVJlcXVlc3QaKi50ZW5zb3JmbG93LnNlcnZpbmcuTXVsdGlJbmZl",
"cmVuY2VSZXNwb25zZRJtChBHZXRNb2RlbE1ldGFkYXRhEisudGVuc29yZmxv",
"dy5zZXJ2aW5nLkdldE1vZGVsTWV0YWRhdGFSZXF1ZXN0GiwudGVuc29yZmxv",
"dy5zZXJ2aW5nLkdldE1vZGVsTWV0YWRhdGFSZXNwb25zZUID+AEBYgZwcm90",
"bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.Serving.ClassificationReflection.Descriptor, global::Tensorflow.Serving.GetModelMetadataReflection.Descriptor, global::Tensorflow.Serving.InferenceReflection.Descriptor, global::Tensorflow.Serving.PredictReflection.Descriptor, global::Tensorflow.Serving.RegressionReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null));
}
#endregion
}
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,397 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/prediction_service.proto
#pragma warning disable 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace Tensorflow.Serving {
/// <summary>
/// open source marker; do not remove
/// PredictionService provides access to machine-learned models loaded by
/// model_servers.
/// </summary>
public static partial class PredictionService
{
static readonly string __ServiceName = "tensorflow.serving.PredictionService";
static readonly grpc::Marshaller<global::Tensorflow.Serving.ClassificationRequest> __Marshaller_ClassificationRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.ClassificationRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Tensorflow.Serving.ClassificationResponse> __Marshaller_ClassificationResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.ClassificationResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Tensorflow.Serving.RegressionRequest> __Marshaller_RegressionRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.RegressionRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Tensorflow.Serving.RegressionResponse> __Marshaller_RegressionResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.RegressionResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Tensorflow.Serving.PredictRequest> __Marshaller_PredictRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.PredictRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Tensorflow.Serving.PredictResponse> __Marshaller_PredictResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.PredictResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Tensorflow.Serving.MultiInferenceRequest> __Marshaller_MultiInferenceRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.MultiInferenceRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Tensorflow.Serving.MultiInferenceResponse> __Marshaller_MultiInferenceResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.MultiInferenceResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Tensorflow.Serving.GetModelMetadataRequest> __Marshaller_GetModelMetadataRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.GetModelMetadataRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Tensorflow.Serving.GetModelMetadataResponse> __Marshaller_GetModelMetadataResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Tensorflow.Serving.GetModelMetadataResponse.Parser.ParseFrom);
static readonly grpc::Method<global::Tensorflow.Serving.ClassificationRequest, global::Tensorflow.Serving.ClassificationResponse> __Method_Classify = new grpc::Method<global::Tensorflow.Serving.ClassificationRequest, global::Tensorflow.Serving.ClassificationResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Classify",
__Marshaller_ClassificationRequest,
__Marshaller_ClassificationResponse);
static readonly grpc::Method<global::Tensorflow.Serving.RegressionRequest, global::Tensorflow.Serving.RegressionResponse> __Method_Regress = new grpc::Method<global::Tensorflow.Serving.RegressionRequest, global::Tensorflow.Serving.RegressionResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Regress",
__Marshaller_RegressionRequest,
__Marshaller_RegressionResponse);
static readonly grpc::Method<global::Tensorflow.Serving.PredictRequest, global::Tensorflow.Serving.PredictResponse> __Method_Predict = new grpc::Method<global::Tensorflow.Serving.PredictRequest, global::Tensorflow.Serving.PredictResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Predict",
__Marshaller_PredictRequest,
__Marshaller_PredictResponse);
static readonly grpc::Method<global::Tensorflow.Serving.MultiInferenceRequest, global::Tensorflow.Serving.MultiInferenceResponse> __Method_MultiInference = new grpc::Method<global::Tensorflow.Serving.MultiInferenceRequest, global::Tensorflow.Serving.MultiInferenceResponse>(
grpc::MethodType.Unary,
__ServiceName,
"MultiInference",
__Marshaller_MultiInferenceRequest,
__Marshaller_MultiInferenceResponse);
static readonly grpc::Method<global::Tensorflow.Serving.GetModelMetadataRequest, global::Tensorflow.Serving.GetModelMetadataResponse> __Method_GetModelMetadata = new grpc::Method<global::Tensorflow.Serving.GetModelMetadataRequest, global::Tensorflow.Serving.GetModelMetadataResponse>(
grpc::MethodType.Unary,
__ServiceName,
"GetModelMetadata",
__Marshaller_GetModelMetadataRequest,
__Marshaller_GetModelMetadataResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Tensorflow.Serving.PredictionServiceReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of PredictionService</summary>
public abstract partial class PredictionServiceBase
{
/// <summary>
/// Classify.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Tensorflow.Serving.ClassificationResponse> Classify(global::Tensorflow.Serving.ClassificationRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Regress.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Tensorflow.Serving.RegressionResponse> Regress(global::Tensorflow.Serving.RegressionRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Predict -- provides access to loaded TensorFlow model.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Tensorflow.Serving.PredictResponse> Predict(global::Tensorflow.Serving.PredictRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// MultiInference API for multi-headed models.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Tensorflow.Serving.MultiInferenceResponse> MultiInference(global::Tensorflow.Serving.MultiInferenceRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// GetModelMetadata - provides access to metadata for loaded models.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Tensorflow.Serving.GetModelMetadataResponse> GetModelMetadata(global::Tensorflow.Serving.GetModelMetadataRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for PredictionService</summary>
public partial class PredictionServiceClient : grpc::ClientBase<PredictionServiceClient>
{
/// <summary>Creates a new client for PredictionService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public PredictionServiceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for PredictionService that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public PredictionServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected PredictionServiceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected PredictionServiceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
/// <summary>
/// Classify.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.ClassificationResponse Classify(global::Tensorflow.Serving.ClassificationRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Classify(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Classify.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.ClassificationResponse Classify(global::Tensorflow.Serving.ClassificationRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Classify, null, options, request);
}
/// <summary>
/// Classify.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.ClassificationResponse> ClassifyAsync(global::Tensorflow.Serving.ClassificationRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return ClassifyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Classify.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.ClassificationResponse> ClassifyAsync(global::Tensorflow.Serving.ClassificationRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Classify, null, options, request);
}
/// <summary>
/// Regress.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.RegressionResponse Regress(global::Tensorflow.Serving.RegressionRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Regress(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Regress.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.RegressionResponse Regress(global::Tensorflow.Serving.RegressionRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Regress, null, options, request);
}
/// <summary>
/// Regress.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.RegressionResponse> RegressAsync(global::Tensorflow.Serving.RegressionRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return RegressAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Regress.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.RegressionResponse> RegressAsync(global::Tensorflow.Serving.RegressionRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Regress, null, options, request);
}
/// <summary>
/// Predict -- provides access to loaded TensorFlow model.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.PredictResponse Predict(global::Tensorflow.Serving.PredictRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Predict(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Predict -- provides access to loaded TensorFlow model.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.PredictResponse Predict(global::Tensorflow.Serving.PredictRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Predict, null, options, request);
}
/// <summary>
/// Predict -- provides access to loaded TensorFlow model.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.PredictResponse> PredictAsync(global::Tensorflow.Serving.PredictRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return PredictAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Predict -- provides access to loaded TensorFlow model.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.PredictResponse> PredictAsync(global::Tensorflow.Serving.PredictRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Predict, null, options, request);
}
/// <summary>
/// MultiInference API for multi-headed models.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.MultiInferenceResponse MultiInference(global::Tensorflow.Serving.MultiInferenceRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return MultiInference(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// MultiInference API for multi-headed models.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.MultiInferenceResponse MultiInference(global::Tensorflow.Serving.MultiInferenceRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_MultiInference, null, options, request);
}
/// <summary>
/// MultiInference API for multi-headed models.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.MultiInferenceResponse> MultiInferenceAsync(global::Tensorflow.Serving.MultiInferenceRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return MultiInferenceAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// MultiInference API for multi-headed models.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.MultiInferenceResponse> MultiInferenceAsync(global::Tensorflow.Serving.MultiInferenceRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_MultiInference, null, options, request);
}
/// <summary>
/// GetModelMetadata - provides access to metadata for loaded models.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.GetModelMetadataResponse GetModelMetadata(global::Tensorflow.Serving.GetModelMetadataRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetModelMetadata(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetModelMetadata - provides access to metadata for loaded models.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Tensorflow.Serving.GetModelMetadataResponse GetModelMetadata(global::Tensorflow.Serving.GetModelMetadataRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_GetModelMetadata, null, options, request);
}
/// <summary>
/// GetModelMetadata - provides access to metadata for loaded models.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.GetModelMetadataResponse> GetModelMetadataAsync(global::Tensorflow.Serving.GetModelMetadataRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetModelMetadataAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetModelMetadata - provides access to metadata for loaded models.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Tensorflow.Serving.GetModelMetadataResponse> GetModelMetadataAsync(global::Tensorflow.Serving.GetModelMetadataRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_GetModelMetadata, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override PredictionServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new PredictionServiceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(PredictionServiceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_Classify, serviceImpl.Classify)
.AddMethod(__Method_Regress, serviceImpl.Regress)
.AddMethod(__Method_Predict, serviceImpl.Predict)
.AddMethod(__Method_MultiInference, serviceImpl.MultiInference)
.AddMethod(__Method_GetModelMetadata, serviceImpl.GetModelMetadata).Build();
}
}
}
#endregion

Просмотреть файл

@ -0,0 +1,571 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/regression.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Serving {
/// <summary>Holder for reflection information generated from tensorflow_serving/apis/regression.proto</summary>
public static partial class RegressionReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow_serving/apis/regression.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static RegressionReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cih0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9yZWdyZXNzaW9uLnByb3RvEhJ0",
"ZW5zb3JmbG93LnNlcnZpbmcaI3RlbnNvcmZsb3dfc2VydmluZy9hcGlzL2lu",
"cHV0LnByb3RvGiN0ZW5zb3JmbG93X3NlcnZpbmcvYXBpcy9tb2RlbC5wcm90",
"byIbCgpSZWdyZXNzaW9uEg0KBXZhbHVlGAEgASgCIkcKEFJlZ3Jlc3Npb25S",
"ZXN1bHQSMwoLcmVncmVzc2lvbnMYASADKAsyHi50ZW5zb3JmbG93LnNlcnZp",
"bmcuUmVncmVzc2lvbiJwChFSZWdyZXNzaW9uUmVxdWVzdBIxCgptb2RlbF9z",
"cGVjGAEgASgLMh0udGVuc29yZmxvdy5zZXJ2aW5nLk1vZGVsU3BlYxIoCgVp",
"bnB1dBgCIAEoCzIZLnRlbnNvcmZsb3cuc2VydmluZy5JbnB1dCJKChJSZWdy",
"ZXNzaW9uUmVzcG9uc2USNAoGcmVzdWx0GAEgASgLMiQudGVuc29yZmxvdy5z",
"ZXJ2aW5nLlJlZ3Jlc3Npb25SZXN1bHRCA/gBAWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.Serving.InputReflection.Descriptor, global::Tensorflow.Serving.ModelReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.Regression), global::Tensorflow.Serving.Regression.Parser, new[]{ "Value" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.RegressionResult), global::Tensorflow.Serving.RegressionResult.Parser, new[]{ "Regressions" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.RegressionRequest), global::Tensorflow.Serving.RegressionRequest.Parser, new[]{ "ModelSpec", "Input" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Serving.RegressionResponse), global::Tensorflow.Serving.RegressionResponse.Parser, new[]{ "Result" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Regression result for a single item (tensorflow.Example).
/// </summary>
public sealed partial class Regression : pb::IMessage<Regression> {
private static readonly pb::MessageParser<Regression> _parser = new pb::MessageParser<Regression>(() => new Regression());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Regression> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.RegressionReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Regression() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Regression(Regression other) : this() {
value_ = other.value_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Regression Clone() {
return new Regression(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private float value_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float Value {
get { return value_; }
set {
value_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Regression);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Regression other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Value != other.Value) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Value != 0F) hash ^= Value.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Value != 0F) {
output.WriteRawTag(13);
output.WriteFloat(Value);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Value != 0F) {
size += 1 + 4;
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Regression other) {
if (other == null) {
return;
}
if (other.Value != 0F) {
Value = other.Value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 13: {
Value = input.ReadFloat();
break;
}
}
}
}
}
/// <summary>
/// Contains one result per input example, in the same order as the input in
/// RegressionRequest.
/// </summary>
public sealed partial class RegressionResult : pb::IMessage<RegressionResult> {
private static readonly pb::MessageParser<RegressionResult> _parser = new pb::MessageParser<RegressionResult>(() => new RegressionResult());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RegressionResult> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.RegressionReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegressionResult() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegressionResult(RegressionResult other) : this() {
regressions_ = other.regressions_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegressionResult Clone() {
return new RegressionResult(this);
}
/// <summary>Field number for the "regressions" field.</summary>
public const int RegressionsFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Serving.Regression> _repeated_regressions_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Serving.Regression.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Serving.Regression> regressions_ = new pbc::RepeatedField<global::Tensorflow.Serving.Regression>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Serving.Regression> Regressions {
get { return regressions_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as RegressionResult);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(RegressionResult other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!regressions_.Equals(other.regressions_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= regressions_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
regressions_.WriteTo(output, _repeated_regressions_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += regressions_.CalculateSize(_repeated_regressions_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(RegressionResult other) {
if (other == null) {
return;
}
regressions_.Add(other.regressions_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
regressions_.AddEntriesFrom(input, _repeated_regressions_codec);
break;
}
}
}
}
}
public sealed partial class RegressionRequest : pb::IMessage<RegressionRequest> {
private static readonly pb::MessageParser<RegressionRequest> _parser = new pb::MessageParser<RegressionRequest>(() => new RegressionRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RegressionRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.RegressionReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegressionRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegressionRequest(RegressionRequest other) : this() {
ModelSpec = other.modelSpec_ != null ? other.ModelSpec.Clone() : null;
Input = other.input_ != null ? other.Input.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegressionRequest Clone() {
return new RegressionRequest(this);
}
/// <summary>Field number for the "model_spec" field.</summary>
public const int ModelSpecFieldNumber = 1;
private global::Tensorflow.Serving.ModelSpec modelSpec_;
/// <summary>
/// Model Specification.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.ModelSpec ModelSpec {
get { return modelSpec_; }
set {
modelSpec_ = value;
}
}
/// <summary>Field number for the "input" field.</summary>
public const int InputFieldNumber = 2;
private global::Tensorflow.Serving.Input input_;
/// <summary>
/// Input data.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.Input Input {
get { return input_; }
set {
input_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as RegressionRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(RegressionRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(ModelSpec, other.ModelSpec)) return false;
if (!object.Equals(Input, other.Input)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (modelSpec_ != null) hash ^= ModelSpec.GetHashCode();
if (input_ != null) hash ^= Input.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (modelSpec_ != null) {
output.WriteRawTag(10);
output.WriteMessage(ModelSpec);
}
if (input_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Input);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (modelSpec_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ModelSpec);
}
if (input_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Input);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(RegressionRequest other) {
if (other == null) {
return;
}
if (other.modelSpec_ != null) {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
ModelSpec.MergeFrom(other.ModelSpec);
}
if (other.input_ != null) {
if (input_ == null) {
input_ = new global::Tensorflow.Serving.Input();
}
Input.MergeFrom(other.Input);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (modelSpec_ == null) {
modelSpec_ = new global::Tensorflow.Serving.ModelSpec();
}
input.ReadMessage(modelSpec_);
break;
}
case 18: {
if (input_ == null) {
input_ = new global::Tensorflow.Serving.Input();
}
input.ReadMessage(input_);
break;
}
}
}
}
}
public sealed partial class RegressionResponse : pb::IMessage<RegressionResponse> {
private static readonly pb::MessageParser<RegressionResponse> _parser = new pb::MessageParser<RegressionResponse>(() => new RegressionResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RegressionResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Serving.RegressionReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegressionResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegressionResponse(RegressionResponse other) : this() {
Result = other.result_ != null ? other.Result.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegressionResponse Clone() {
return new RegressionResponse(this);
}
/// <summary>Field number for the "result" field.</summary>
public const int ResultFieldNumber = 1;
private global::Tensorflow.Serving.RegressionResult result_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Serving.RegressionResult Result {
get { return result_; }
set {
result_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as RegressionResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(RegressionResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Result, other.Result)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (result_ != null) hash ^= Result.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (result_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Result);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (result_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Result);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(RegressionResponse other) {
if (other == null) {
return;
}
if (other.result_ != null) {
if (result_ == null) {
result_ = new global::Tensorflow.Serving.RegressionResult();
}
Result.MergeFrom(other.Result);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (result_ == null) {
result_ = new global::Tensorflow.Serving.RegressionResult();
}
input.ReadMessage(result_);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,321 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/allocation_description.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/allocation_description.proto</summary>
public static partial class AllocationDescriptionReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/allocation_description.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static AllocationDescriptionReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjZ0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2FsbG9jYXRpb25fZGVzY3Jp",
"cHRpb24ucHJvdG8SCnRlbnNvcmZsb3ciowEKFUFsbG9jYXRpb25EZXNjcmlw",
"dGlvbhIXCg9yZXF1ZXN0ZWRfYnl0ZXMYASABKAMSFwoPYWxsb2NhdGVkX2J5",
"dGVzGAIgASgDEhYKDmFsbG9jYXRvcl9uYW1lGAMgASgJEhUKDWFsbG9jYXRp",
"b25faWQYBCABKAMSHAoUaGFzX3NpbmdsZV9yZWZlcmVuY2UYBSABKAgSCwoD",
"cHRyGAYgASgEQjwKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IbQWxsb2Nh",
"dGlvbkRlc2NyaXB0aW9uUHJvdG9zUAH4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AllocationDescription), global::Tensorflow.AllocationDescription.Parser, new[]{ "RequestedBytes", "AllocatedBytes", "AllocatorName", "AllocationId", "HasSingleReference", "Ptr" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class AllocationDescription : pb::IMessage<AllocationDescription> {
private static readonly pb::MessageParser<AllocationDescription> _parser = new pb::MessageParser<AllocationDescription>(() => new AllocationDescription());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AllocationDescription> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.AllocationDescriptionReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AllocationDescription() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AllocationDescription(AllocationDescription other) : this() {
requestedBytes_ = other.requestedBytes_;
allocatedBytes_ = other.allocatedBytes_;
allocatorName_ = other.allocatorName_;
allocationId_ = other.allocationId_;
hasSingleReference_ = other.hasSingleReference_;
ptr_ = other.ptr_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AllocationDescription Clone() {
return new AllocationDescription(this);
}
/// <summary>Field number for the "requested_bytes" field.</summary>
public const int RequestedBytesFieldNumber = 1;
private long requestedBytes_;
/// <summary>
/// Total number of bytes requested
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long RequestedBytes {
get { return requestedBytes_; }
set {
requestedBytes_ = value;
}
}
/// <summary>Field number for the "allocated_bytes" field.</summary>
public const int AllocatedBytesFieldNumber = 2;
private long allocatedBytes_;
/// <summary>
/// Total number of bytes allocated if known
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long AllocatedBytes {
get { return allocatedBytes_; }
set {
allocatedBytes_ = value;
}
}
/// <summary>Field number for the "allocator_name" field.</summary>
public const int AllocatorNameFieldNumber = 3;
private string allocatorName_ = "";
/// <summary>
/// Name of the allocator used
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string AllocatorName {
get { return allocatorName_; }
set {
allocatorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "allocation_id" field.</summary>
public const int AllocationIdFieldNumber = 4;
private long allocationId_;
/// <summary>
/// Identifier of the allocated buffer if known
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long AllocationId {
get { return allocationId_; }
set {
allocationId_ = value;
}
}
/// <summary>Field number for the "has_single_reference" field.</summary>
public const int HasSingleReferenceFieldNumber = 5;
private bool hasSingleReference_;
/// <summary>
/// Set if this tensor only has one remaining reference
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool HasSingleReference {
get { return hasSingleReference_; }
set {
hasSingleReference_ = value;
}
}
/// <summary>Field number for the "ptr" field.</summary>
public const int PtrFieldNumber = 6;
private ulong ptr_;
/// <summary>
/// Address of the allocation.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ulong Ptr {
get { return ptr_; }
set {
ptr_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as AllocationDescription);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(AllocationDescription other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (RequestedBytes != other.RequestedBytes) return false;
if (AllocatedBytes != other.AllocatedBytes) return false;
if (AllocatorName != other.AllocatorName) return false;
if (AllocationId != other.AllocationId) return false;
if (HasSingleReference != other.HasSingleReference) return false;
if (Ptr != other.Ptr) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (RequestedBytes != 0L) hash ^= RequestedBytes.GetHashCode();
if (AllocatedBytes != 0L) hash ^= AllocatedBytes.GetHashCode();
if (AllocatorName.Length != 0) hash ^= AllocatorName.GetHashCode();
if (AllocationId != 0L) hash ^= AllocationId.GetHashCode();
if (HasSingleReference != false) hash ^= HasSingleReference.GetHashCode();
if (Ptr != 0UL) hash ^= Ptr.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (RequestedBytes != 0L) {
output.WriteRawTag(8);
output.WriteInt64(RequestedBytes);
}
if (AllocatedBytes != 0L) {
output.WriteRawTag(16);
output.WriteInt64(AllocatedBytes);
}
if (AllocatorName.Length != 0) {
output.WriteRawTag(26);
output.WriteString(AllocatorName);
}
if (AllocationId != 0L) {
output.WriteRawTag(32);
output.WriteInt64(AllocationId);
}
if (HasSingleReference != false) {
output.WriteRawTag(40);
output.WriteBool(HasSingleReference);
}
if (Ptr != 0UL) {
output.WriteRawTag(48);
output.WriteUInt64(Ptr);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (RequestedBytes != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(RequestedBytes);
}
if (AllocatedBytes != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocatedBytes);
}
if (AllocatorName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(AllocatorName);
}
if (AllocationId != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocationId);
}
if (HasSingleReference != false) {
size += 1 + 1;
}
if (Ptr != 0UL) {
size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Ptr);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(AllocationDescription other) {
if (other == null) {
return;
}
if (other.RequestedBytes != 0L) {
RequestedBytes = other.RequestedBytes;
}
if (other.AllocatedBytes != 0L) {
AllocatedBytes = other.AllocatedBytes;
}
if (other.AllocatorName.Length != 0) {
AllocatorName = other.AllocatorName;
}
if (other.AllocationId != 0L) {
AllocationId = other.AllocationId;
}
if (other.HasSingleReference != false) {
HasSingleReference = other.HasSingleReference;
}
if (other.Ptr != 0UL) {
Ptr = other.Ptr;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
RequestedBytes = input.ReadInt64();
break;
}
case 16: {
AllocatedBytes = input.ReadInt64();
break;
}
case 26: {
AllocatorName = input.ReadString();
break;
}
case 32: {
AllocationId = input.ReadInt64();
break;
}
case 40: {
HasSingleReference = input.ReadBool();
break;
}
case 48: {
Ptr = input.ReadUInt64();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,978 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/attr_value.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/attr_value.proto</summary>
public static partial class AttrValueReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/attr_value.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static AttrValueReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2F0dHJfdmFsdWUucHJvdG8S",
"CnRlbnNvcmZsb3caJnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVuc29y",
"LnByb3RvGix0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvcl9zaGFw",
"ZS5wcm90bxoldGVuc29yZmxvdy9jb3JlL2ZyYW1ld29yay90eXBlcy5wcm90",
"byKmBAoJQXR0clZhbHVlEgsKAXMYAiABKAxIABILCgFpGAMgASgDSAASCwoB",
"ZhgEIAEoAkgAEgsKAWIYBSABKAhIABIkCgR0eXBlGAYgASgOMhQudGVuc29y",
"Zmxvdy5EYXRhVHlwZUgAEi0KBXNoYXBlGAcgASgLMhwudGVuc29yZmxvdy5U",
"ZW5zb3JTaGFwZVByb3RvSAASKQoGdGVuc29yGAggASgLMhcudGVuc29yZmxv",
"dy5UZW5zb3JQcm90b0gAEi8KBGxpc3QYASABKAsyHy50ZW5zb3JmbG93LkF0",
"dHJWYWx1ZS5MaXN0VmFsdWVIABIoCgRmdW5jGAogASgLMhgudGVuc29yZmxv",
"dy5OYW1lQXR0ckxpc3RIABIVCgtwbGFjZWhvbGRlchgJIAEoCUgAGukBCglM",
"aXN0VmFsdWUSCQoBcxgCIAMoDBINCgFpGAMgAygDQgIQARINCgFmGAQgAygC",
"QgIQARINCgFiGAUgAygIQgIQARImCgR0eXBlGAYgAygOMhQudGVuc29yZmxv",
"dy5EYXRhVHlwZUICEAESKwoFc2hhcGUYByADKAsyHC50ZW5zb3JmbG93LlRl",
"bnNvclNoYXBlUHJvdG8SJwoGdGVuc29yGAggAygLMhcudGVuc29yZmxvdy5U",
"ZW5zb3JQcm90bxImCgRmdW5jGAkgAygLMhgudGVuc29yZmxvdy5OYW1lQXR0",
"ckxpc3RCBwoFdmFsdWUikgEKDE5hbWVBdHRyTGlzdBIMCgRuYW1lGAEgASgJ",
"EjAKBGF0dHIYAiADKAsyIi50ZW5zb3JmbG93Lk5hbWVBdHRyTGlzdC5BdHRy",
"RW50cnkaQgoJQXR0ckVudHJ5EgsKA2tleRgBIAEoCRIkCgV2YWx1ZRgCIAEo",
"CzIVLnRlbnNvcmZsb3cuQXR0clZhbHVlOgI4AUIwChhvcmcudGVuc29yZmxv",
"dy5mcmFtZXdvcmtCD0F0dHJWYWx1ZVByb3Rvc1AB+AEBYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.TensorReflection.Descriptor, global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.TypesReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AttrValue), global::Tensorflow.AttrValue.Parser, new[]{ "S", "I", "F", "B", "Type", "Shape", "Tensor", "List", "Func", "Placeholder" }, new[]{ "Value" }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AttrValue.Types.ListValue), global::Tensorflow.AttrValue.Types.ListValue.Parser, new[]{ "S", "I", "F", "B", "Type", "Shape", "Tensor", "Func" }, null, null, null)}),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.NameAttrList), global::Tensorflow.NameAttrList.Parser, new[]{ "Name", "Attr" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
}));
}
#endregion
}
#region Messages
/// <summary>
/// Protocol buffer representing the value for an attr used to configure an Op.
/// Comment indicates the corresponding attr type. Only the field matching the
/// attr type may be filled.
/// </summary>
public sealed partial class AttrValue : pb::IMessage<AttrValue> {
private static readonly pb::MessageParser<AttrValue> _parser = new pb::MessageParser<AttrValue>(() => new AttrValue());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AttrValue> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.AttrValueReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AttrValue() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AttrValue(AttrValue other) : this() {
switch (other.ValueCase) {
case ValueOneofCase.S:
S = other.S;
break;
case ValueOneofCase.I:
I = other.I;
break;
case ValueOneofCase.F:
F = other.F;
break;
case ValueOneofCase.B:
B = other.B;
break;
case ValueOneofCase.Type:
Type = other.Type;
break;
case ValueOneofCase.Shape:
Shape = other.Shape.Clone();
break;
case ValueOneofCase.Tensor:
Tensor = other.Tensor.Clone();
break;
case ValueOneofCase.List:
List = other.List.Clone();
break;
case ValueOneofCase.Func:
Func = other.Func.Clone();
break;
case ValueOneofCase.Placeholder:
Placeholder = other.Placeholder;
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AttrValue Clone() {
return new AttrValue(this);
}
/// <summary>Field number for the "s" field.</summary>
public const int SFieldNumber = 2;
/// <summary>
/// "string"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString S {
get { return valueCase_ == ValueOneofCase.S ? (pb::ByteString) value_ : pb::ByteString.Empty; }
set {
value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
valueCase_ = ValueOneofCase.S;
}
}
/// <summary>Field number for the "i" field.</summary>
public const int IFieldNumber = 3;
/// <summary>
/// "int"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long I {
get { return valueCase_ == ValueOneofCase.I ? (long) value_ : 0L; }
set {
value_ = value;
valueCase_ = ValueOneofCase.I;
}
}
/// <summary>Field number for the "f" field.</summary>
public const int FFieldNumber = 4;
/// <summary>
/// "float"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float F {
get { return valueCase_ == ValueOneofCase.F ? (float) value_ : 0F; }
set {
value_ = value;
valueCase_ = ValueOneofCase.F;
}
}
/// <summary>Field number for the "b" field.</summary>
public const int BFieldNumber = 5;
/// <summary>
/// "bool"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool B {
get { return valueCase_ == ValueOneofCase.B ? (bool) value_ : false; }
set {
value_ = value;
valueCase_ = ValueOneofCase.B;
}
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 6;
/// <summary>
/// "type"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.DataType Type {
get { return valueCase_ == ValueOneofCase.Type ? (global::Tensorflow.DataType) value_ : 0; }
set {
value_ = value;
valueCase_ = ValueOneofCase.Type;
}
}
/// <summary>Field number for the "shape" field.</summary>
public const int ShapeFieldNumber = 7;
/// <summary>
/// "shape"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.TensorShapeProto Shape {
get { return valueCase_ == ValueOneofCase.Shape ? (global::Tensorflow.TensorShapeProto) value_ : null; }
set {
value_ = value;
valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.Shape;
}
}
/// <summary>Field number for the "tensor" field.</summary>
public const int TensorFieldNumber = 8;
/// <summary>
/// "tensor"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.TensorProto Tensor {
get { return valueCase_ == ValueOneofCase.Tensor ? (global::Tensorflow.TensorProto) value_ : null; }
set {
value_ = value;
valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.Tensor;
}
}
/// <summary>Field number for the "list" field.</summary>
public const int ListFieldNumber = 1;
/// <summary>
/// any "list(...)"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.AttrValue.Types.ListValue List {
get { return valueCase_ == ValueOneofCase.List ? (global::Tensorflow.AttrValue.Types.ListValue) value_ : null; }
set {
value_ = value;
valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.List;
}
}
/// <summary>Field number for the "func" field.</summary>
public const int FuncFieldNumber = 10;
/// <summary>
/// "func" represents a function. func.name is a function's name or
/// a primitive op's name. func.attr.first is the name of an attr
/// defined for that function. func.attr.second is the value for
/// that attr in the instantiation.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.NameAttrList Func {
get { return valueCase_ == ValueOneofCase.Func ? (global::Tensorflow.NameAttrList) value_ : null; }
set {
value_ = value;
valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.Func;
}
}
/// <summary>Field number for the "placeholder" field.</summary>
public const int PlaceholderFieldNumber = 9;
/// <summary>
/// This is a placeholder only used in nodes defined inside a
/// function. It indicates the attr value will be supplied when
/// the function is instantiated. For example, let us suppose a
/// node "N" in function "FN". "N" has an attr "A" with value
/// placeholder = "foo". When FN is instantiated with attr "foo"
/// set to "bar", the instantiated node N's attr A will have been
/// given the value "bar".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Placeholder {
get { return valueCase_ == ValueOneofCase.Placeholder ? (string) value_ : ""; }
set {
value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
valueCase_ = ValueOneofCase.Placeholder;
}
}
private object value_;
/// <summary>Enum of possible cases for the "value" oneof.</summary>
public enum ValueOneofCase {
None = 0,
S = 2,
I = 3,
F = 4,
B = 5,
Type = 6,
Shape = 7,
Tensor = 8,
List = 1,
Func = 10,
Placeholder = 9,
}
private ValueOneofCase valueCase_ = ValueOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValueOneofCase ValueCase {
get { return valueCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearValue() {
valueCase_ = ValueOneofCase.None;
value_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as AttrValue);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(AttrValue other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (S != other.S) return false;
if (I != other.I) return false;
if (F != other.F) return false;
if (B != other.B) return false;
if (Type != other.Type) return false;
if (!object.Equals(Shape, other.Shape)) return false;
if (!object.Equals(Tensor, other.Tensor)) return false;
if (!object.Equals(List, other.List)) return false;
if (!object.Equals(Func, other.Func)) return false;
if (Placeholder != other.Placeholder) return false;
if (ValueCase != other.ValueCase) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (valueCase_ == ValueOneofCase.S) hash ^= S.GetHashCode();
if (valueCase_ == ValueOneofCase.I) hash ^= I.GetHashCode();
if (valueCase_ == ValueOneofCase.F) hash ^= F.GetHashCode();
if (valueCase_ == ValueOneofCase.B) hash ^= B.GetHashCode();
if (valueCase_ == ValueOneofCase.Type) hash ^= Type.GetHashCode();
if (valueCase_ == ValueOneofCase.Shape) hash ^= Shape.GetHashCode();
if (valueCase_ == ValueOneofCase.Tensor) hash ^= Tensor.GetHashCode();
if (valueCase_ == ValueOneofCase.List) hash ^= List.GetHashCode();
if (valueCase_ == ValueOneofCase.Func) hash ^= Func.GetHashCode();
if (valueCase_ == ValueOneofCase.Placeholder) hash ^= Placeholder.GetHashCode();
hash ^= (int) valueCase_;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (valueCase_ == ValueOneofCase.List) {
output.WriteRawTag(10);
output.WriteMessage(List);
}
if (valueCase_ == ValueOneofCase.S) {
output.WriteRawTag(18);
output.WriteBytes(S);
}
if (valueCase_ == ValueOneofCase.I) {
output.WriteRawTag(24);
output.WriteInt64(I);
}
if (valueCase_ == ValueOneofCase.F) {
output.WriteRawTag(37);
output.WriteFloat(F);
}
if (valueCase_ == ValueOneofCase.B) {
output.WriteRawTag(40);
output.WriteBool(B);
}
if (valueCase_ == ValueOneofCase.Type) {
output.WriteRawTag(48);
output.WriteEnum((int) Type);
}
if (valueCase_ == ValueOneofCase.Shape) {
output.WriteRawTag(58);
output.WriteMessage(Shape);
}
if (valueCase_ == ValueOneofCase.Tensor) {
output.WriteRawTag(66);
output.WriteMessage(Tensor);
}
if (valueCase_ == ValueOneofCase.Placeholder) {
output.WriteRawTag(74);
output.WriteString(Placeholder);
}
if (valueCase_ == ValueOneofCase.Func) {
output.WriteRawTag(82);
output.WriteMessage(Func);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (valueCase_ == ValueOneofCase.S) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(S);
}
if (valueCase_ == ValueOneofCase.I) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(I);
}
if (valueCase_ == ValueOneofCase.F) {
size += 1 + 4;
}
if (valueCase_ == ValueOneofCase.B) {
size += 1 + 1;
}
if (valueCase_ == ValueOneofCase.Type) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
}
if (valueCase_ == ValueOneofCase.Shape) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shape);
}
if (valueCase_ == ValueOneofCase.Tensor) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Tensor);
}
if (valueCase_ == ValueOneofCase.List) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(List);
}
if (valueCase_ == ValueOneofCase.Func) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Func);
}
if (valueCase_ == ValueOneofCase.Placeholder) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Placeholder);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(AttrValue other) {
if (other == null) {
return;
}
switch (other.ValueCase) {
case ValueOneofCase.S:
S = other.S;
break;
case ValueOneofCase.I:
I = other.I;
break;
case ValueOneofCase.F:
F = other.F;
break;
case ValueOneofCase.B:
B = other.B;
break;
case ValueOneofCase.Type:
Type = other.Type;
break;
case ValueOneofCase.Shape:
Shape = other.Shape;
break;
case ValueOneofCase.Tensor:
Tensor = other.Tensor;
break;
case ValueOneofCase.List:
List = other.List;
break;
case ValueOneofCase.Func:
Func = other.Func;
break;
case ValueOneofCase.Placeholder:
Placeholder = other.Placeholder;
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
global::Tensorflow.AttrValue.Types.ListValue subBuilder = new global::Tensorflow.AttrValue.Types.ListValue();
if (valueCase_ == ValueOneofCase.List) {
subBuilder.MergeFrom(List);
}
input.ReadMessage(subBuilder);
List = subBuilder;
break;
}
case 18: {
S = input.ReadBytes();
break;
}
case 24: {
I = input.ReadInt64();
break;
}
case 37: {
F = input.ReadFloat();
break;
}
case 40: {
B = input.ReadBool();
break;
}
case 48: {
value_ = input.ReadEnum();
valueCase_ = ValueOneofCase.Type;
break;
}
case 58: {
global::Tensorflow.TensorShapeProto subBuilder = new global::Tensorflow.TensorShapeProto();
if (valueCase_ == ValueOneofCase.Shape) {
subBuilder.MergeFrom(Shape);
}
input.ReadMessage(subBuilder);
Shape = subBuilder;
break;
}
case 66: {
global::Tensorflow.TensorProto subBuilder = new global::Tensorflow.TensorProto();
if (valueCase_ == ValueOneofCase.Tensor) {
subBuilder.MergeFrom(Tensor);
}
input.ReadMessage(subBuilder);
Tensor = subBuilder;
break;
}
case 74: {
Placeholder = input.ReadString();
break;
}
case 82: {
global::Tensorflow.NameAttrList subBuilder = new global::Tensorflow.NameAttrList();
if (valueCase_ == ValueOneofCase.Func) {
subBuilder.MergeFrom(Func);
}
input.ReadMessage(subBuilder);
Func = subBuilder;
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the AttrValue message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// LINT.IfChange
/// </summary>
public sealed partial class ListValue : pb::IMessage<ListValue> {
private static readonly pb::MessageParser<ListValue> _parser = new pb::MessageParser<ListValue>(() => new ListValue());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ListValue> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.AttrValue.Descriptor.NestedTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ListValue() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ListValue(ListValue other) : this() {
s_ = other.s_.Clone();
i_ = other.i_.Clone();
f_ = other.f_.Clone();
b_ = other.b_.Clone();
type_ = other.type_.Clone();
shape_ = other.shape_.Clone();
tensor_ = other.tensor_.Clone();
func_ = other.func_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ListValue Clone() {
return new ListValue(this);
}
/// <summary>Field number for the "s" field.</summary>
public const int SFieldNumber = 2;
private static readonly pb::FieldCodec<pb::ByteString> _repeated_s_codec
= pb::FieldCodec.ForBytes(18);
private readonly pbc::RepeatedField<pb::ByteString> s_ = new pbc::RepeatedField<pb::ByteString>();
/// <summary>
/// "list(string)"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<pb::ByteString> S {
get { return s_; }
}
/// <summary>Field number for the "i" field.</summary>
public const int IFieldNumber = 3;
private static readonly pb::FieldCodec<long> _repeated_i_codec
= pb::FieldCodec.ForInt64(26);
private readonly pbc::RepeatedField<long> i_ = new pbc::RepeatedField<long>();
/// <summary>
/// "list(int)"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<long> I {
get { return i_; }
}
/// <summary>Field number for the "f" field.</summary>
public const int FFieldNumber = 4;
private static readonly pb::FieldCodec<float> _repeated_f_codec
= pb::FieldCodec.ForFloat(34);
private readonly pbc::RepeatedField<float> f_ = new pbc::RepeatedField<float>();
/// <summary>
/// "list(float)"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> F {
get { return f_; }
}
/// <summary>Field number for the "b" field.</summary>
public const int BFieldNumber = 5;
private static readonly pb::FieldCodec<bool> _repeated_b_codec
= pb::FieldCodec.ForBool(42);
private readonly pbc::RepeatedField<bool> b_ = new pbc::RepeatedField<bool>();
/// <summary>
/// "list(bool)"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<bool> B {
get { return b_; }
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 6;
private static readonly pb::FieldCodec<global::Tensorflow.DataType> _repeated_type_codec
= pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::Tensorflow.DataType) x);
private readonly pbc::RepeatedField<global::Tensorflow.DataType> type_ = new pbc::RepeatedField<global::Tensorflow.DataType>();
/// <summary>
/// "list(type)"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.DataType> Type {
get { return type_; }
}
/// <summary>Field number for the "shape" field.</summary>
public const int ShapeFieldNumber = 7;
private static readonly pb::FieldCodec<global::Tensorflow.TensorShapeProto> _repeated_shape_codec
= pb::FieldCodec.ForMessage(58, global::Tensorflow.TensorShapeProto.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.TensorShapeProto> shape_ = new pbc::RepeatedField<global::Tensorflow.TensorShapeProto>();
/// <summary>
/// "list(shape)"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.TensorShapeProto> Shape {
get { return shape_; }
}
/// <summary>Field number for the "tensor" field.</summary>
public const int TensorFieldNumber = 8;
private static readonly pb::FieldCodec<global::Tensorflow.TensorProto> _repeated_tensor_codec
= pb::FieldCodec.ForMessage(66, global::Tensorflow.TensorProto.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.TensorProto> tensor_ = new pbc::RepeatedField<global::Tensorflow.TensorProto>();
/// <summary>
/// "list(tensor)"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.TensorProto> Tensor {
get { return tensor_; }
}
/// <summary>Field number for the "func" field.</summary>
public const int FuncFieldNumber = 9;
private static readonly pb::FieldCodec<global::Tensorflow.NameAttrList> _repeated_func_codec
= pb::FieldCodec.ForMessage(74, global::Tensorflow.NameAttrList.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.NameAttrList> func_ = new pbc::RepeatedField<global::Tensorflow.NameAttrList>();
/// <summary>
/// "list(attr)"
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.NameAttrList> Func {
get { return func_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ListValue);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ListValue other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!s_.Equals(other.s_)) return false;
if(!i_.Equals(other.i_)) return false;
if(!f_.Equals(other.f_)) return false;
if(!b_.Equals(other.b_)) return false;
if(!type_.Equals(other.type_)) return false;
if(!shape_.Equals(other.shape_)) return false;
if(!tensor_.Equals(other.tensor_)) return false;
if(!func_.Equals(other.func_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= s_.GetHashCode();
hash ^= i_.GetHashCode();
hash ^= f_.GetHashCode();
hash ^= b_.GetHashCode();
hash ^= type_.GetHashCode();
hash ^= shape_.GetHashCode();
hash ^= tensor_.GetHashCode();
hash ^= func_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
s_.WriteTo(output, _repeated_s_codec);
i_.WriteTo(output, _repeated_i_codec);
f_.WriteTo(output, _repeated_f_codec);
b_.WriteTo(output, _repeated_b_codec);
type_.WriteTo(output, _repeated_type_codec);
shape_.WriteTo(output, _repeated_shape_codec);
tensor_.WriteTo(output, _repeated_tensor_codec);
func_.WriteTo(output, _repeated_func_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += s_.CalculateSize(_repeated_s_codec);
size += i_.CalculateSize(_repeated_i_codec);
size += f_.CalculateSize(_repeated_f_codec);
size += b_.CalculateSize(_repeated_b_codec);
size += type_.CalculateSize(_repeated_type_codec);
size += shape_.CalculateSize(_repeated_shape_codec);
size += tensor_.CalculateSize(_repeated_tensor_codec);
size += func_.CalculateSize(_repeated_func_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ListValue other) {
if (other == null) {
return;
}
s_.Add(other.s_);
i_.Add(other.i_);
f_.Add(other.f_);
b_.Add(other.b_);
type_.Add(other.type_);
shape_.Add(other.shape_);
tensor_.Add(other.tensor_);
func_.Add(other.func_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 18: {
s_.AddEntriesFrom(input, _repeated_s_codec);
break;
}
case 26:
case 24: {
i_.AddEntriesFrom(input, _repeated_i_codec);
break;
}
case 34:
case 37: {
f_.AddEntriesFrom(input, _repeated_f_codec);
break;
}
case 42:
case 40: {
b_.AddEntriesFrom(input, _repeated_b_codec);
break;
}
case 50:
case 48: {
type_.AddEntriesFrom(input, _repeated_type_codec);
break;
}
case 58: {
shape_.AddEntriesFrom(input, _repeated_shape_codec);
break;
}
case 66: {
tensor_.AddEntriesFrom(input, _repeated_tensor_codec);
break;
}
case 74: {
func_.AddEntriesFrom(input, _repeated_func_codec);
break;
}
}
}
}
}
}
#endregion
}
/// <summary>
/// A list of attr names and their values. The whole list is attached
/// with a string name. E.g., MatMul[T=float].
/// </summary>
public sealed partial class NameAttrList : pb::IMessage<NameAttrList> {
private static readonly pb::MessageParser<NameAttrList> _parser = new pb::MessageParser<NameAttrList>(() => new NameAttrList());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NameAttrList> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.AttrValueReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NameAttrList() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NameAttrList(NameAttrList other) : this() {
name_ = other.name_;
attr_ = other.attr_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NameAttrList Clone() {
return new NameAttrList(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "attr" field.</summary>
public const int AttrFieldNumber = 2;
private static readonly pbc::MapField<string, global::Tensorflow.AttrValue>.Codec _map_attr_codec
= new pbc::MapField<string, global::Tensorflow.AttrValue>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Tensorflow.AttrValue.Parser), 18);
private readonly pbc::MapField<string, global::Tensorflow.AttrValue> attr_ = new pbc::MapField<string, global::Tensorflow.AttrValue>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Tensorflow.AttrValue> Attr {
get { return attr_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as NameAttrList);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(NameAttrList other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (!Attr.Equals(other.Attr)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
hash ^= Attr.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
attr_.WriteTo(output, _map_attr_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
size += attr_.CalculateSize(_map_attr_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(NameAttrList other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
attr_.Add(other.attr_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
attr_.AddEntriesFrom(input, _map_attr_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,311 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: core/protobuf/cluster.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from core/protobuf/cluster.proto</summary>
public static partial class ClusterReflection {
#region Descriptor
/// <summary>File descriptor for core/protobuf/cluster.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ClusterReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Chtjb3JlL3Byb3RvYnVmL2NsdXN0ZXIucHJvdG8SCnRlbnNvcmZsb3cicgoG",
"Sm9iRGVmEgwKBG5hbWUYASABKAkSLAoFdGFza3MYAiADKAsyHS50ZW5zb3Jm",
"bG93LkpvYkRlZi5UYXNrc0VudHJ5GiwKClRhc2tzRW50cnkSCwoDa2V5GAEg",
"ASgFEg0KBXZhbHVlGAIgASgJOgI4ASItCgpDbHVzdGVyRGVmEh8KA2pvYhgB",
"IAMoCzISLnRlbnNvcmZsb3cuSm9iRGVmQjAKGm9yZy50ZW5zb3JmbG93LmRp",
"c3RydW50aW1lQg1DbHVzdGVyUHJvdG9zUAH4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.JobDef), global::Tensorflow.JobDef.Parser, new[]{ "Name", "Tasks" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ClusterDef), global::Tensorflow.ClusterDef.Parser, new[]{ "Job" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Defines a single job in a TensorFlow cluster.
/// </summary>
public sealed partial class JobDef : pb::IMessage<JobDef> {
private static readonly pb::MessageParser<JobDef> _parser = new pb::MessageParser<JobDef>(() => new JobDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<JobDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.ClusterReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JobDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JobDef(JobDef other) : this() {
name_ = other.name_;
tasks_ = other.tasks_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JobDef Clone() {
return new JobDef(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// The name of this job.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "tasks" field.</summary>
public const int TasksFieldNumber = 2;
private static readonly pbc::MapField<int, string>.Codec _map_tasks_codec
= new pbc::MapField<int, string>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForString(18), 18);
private readonly pbc::MapField<int, string> tasks_ = new pbc::MapField<int, string>();
/// <summary>
/// Mapping from task ID to "hostname:port" string.
///
/// If the `name` field contains "worker", and the `tasks` map contains a
/// mapping from 7 to "example.org:2222", then the device prefix
/// "/job:worker/task:7" will be assigned to "example.org:2222".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<int, string> Tasks {
get { return tasks_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as JobDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(JobDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (!Tasks.Equals(other.Tasks)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
hash ^= Tasks.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
tasks_.WriteTo(output, _map_tasks_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
size += tasks_.CalculateSize(_map_tasks_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(JobDef other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
tasks_.Add(other.tasks_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
tasks_.AddEntriesFrom(input, _map_tasks_codec);
break;
}
}
}
}
}
/// <summary>
/// Defines a TensorFlow cluster as a set of jobs.
/// </summary>
public sealed partial class ClusterDef : pb::IMessage<ClusterDef> {
private static readonly pb::MessageParser<ClusterDef> _parser = new pb::MessageParser<ClusterDef>(() => new ClusterDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ClusterDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.ClusterReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClusterDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClusterDef(ClusterDef other) : this() {
job_ = other.job_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClusterDef Clone() {
return new ClusterDef(this);
}
/// <summary>Field number for the "job" field.</summary>
public const int JobFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.JobDef> _repeated_job_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.JobDef.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.JobDef> job_ = new pbc::RepeatedField<global::Tensorflow.JobDef>();
/// <summary>
/// The jobs that comprise the cluster.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.JobDef> Job {
get { return job_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ClusterDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ClusterDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!job_.Equals(other.job_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= job_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
job_.WriteTo(output, _repeated_job_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += job_.CalculateSize(_repeated_job_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ClusterDef other) {
if (other == null) {
return;
}
job_.Add(other.job_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
job_.AddEntriesFrom(input, _repeated_job_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,840 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/control_flow.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/control_flow.proto</summary>
public static partial class ControlFlowReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/control_flow.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ControlFlowReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cit0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvY29udHJvbF9mbG93LnByb3Rv",
"Egp0ZW5zb3JmbG93IpYBCglWYWx1ZXNEZWYSDgoGdmFsdWVzGAEgAygJEkIK",
"D2V4dGVybmFsX3ZhbHVlcxgCIAMoCzIpLnRlbnNvcmZsb3cuVmFsdWVzRGVm",
"LkV4dGVybmFsVmFsdWVzRW50cnkaNQoTRXh0ZXJuYWxWYWx1ZXNFbnRyeRIL",
"CgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIogBCg5Db25kQ29udGV4",
"dERlZhIUCgxjb250ZXh0X25hbWUYASABKAkSEQoJcHJlZF9uYW1lGAIgASgJ",
"EhIKCnBpdm90X25hbWUYAyABKAkSDgoGYnJhbmNoGAQgASgFEikKCnZhbHVl",
"c19kZWYYBSABKAsyFS50ZW5zb3JmbG93LlZhbHVlc0RlZiKYAgoPV2hpbGVD",
"b250ZXh0RGVmEhQKDGNvbnRleHRfbmFtZRgBIAEoCRIbChNwYXJhbGxlbF9p",
"dGVyYXRpb25zGAIgASgFEhEKCWJhY2tfcHJvcBgDIAEoCBITCgtzd2FwX21l",
"bW9yeRgEIAEoCBISCgpwaXZvdF9uYW1lGAUgASgJEhsKE3Bpdm90X2Zvcl9w",
"cmVkX25hbWUYBiABKAkSGwoTcGl2b3RfZm9yX2JvZHlfbmFtZRgHIAEoCRIX",
"Cg9sb29wX2V4aXRfbmFtZXMYCCADKAkSGAoQbG9vcF9lbnRlcl9uYW1lcxgK",
"IAMoCRIpCgp2YWx1ZXNfZGVmGAkgASgLMhUudGVuc29yZmxvdy5WYWx1ZXNE",
"ZWZCMgoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQhFDb250cm9sRmxvd1By",
"b3Rvc1AB+AEBYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ValuesDef), global::Tensorflow.ValuesDef.Parser, new[]{ "Values", "ExternalValues" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.CondContextDef), global::Tensorflow.CondContextDef.Parser, new[]{ "ContextName", "PredName", "PivotName", "Branch", "ValuesDef" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.WhileContextDef), global::Tensorflow.WhileContextDef.Parser, new[]{ "ContextName", "ParallelIterations", "BackProp", "SwapMemory", "PivotName", "PivotForPredName", "PivotForBodyName", "LoopExitNames", "LoopEnterNames", "ValuesDef" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Protocol buffer representing the values in ControlFlowContext.
/// </summary>
public sealed partial class ValuesDef : pb::IMessage<ValuesDef> {
private static readonly pb::MessageParser<ValuesDef> _parser = new pb::MessageParser<ValuesDef>(() => new ValuesDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ValuesDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.ControlFlowReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValuesDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValuesDef(ValuesDef other) : this() {
values_ = other.values_.Clone();
externalValues_ = other.externalValues_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValuesDef Clone() {
return new ValuesDef(this);
}
/// <summary>Field number for the "values" field.</summary>
public const int ValuesFieldNumber = 1;
private static readonly pb::FieldCodec<string> _repeated_values_codec
= pb::FieldCodec.ForString(10);
private readonly pbc::RepeatedField<string> values_ = new pbc::RepeatedField<string>();
/// <summary>
/// Value names that have been seen in this context.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Values {
get { return values_; }
}
/// <summary>Field number for the "external_values" field.</summary>
public const int ExternalValuesFieldNumber = 2;
private static readonly pbc::MapField<string, string>.Codec _map_externalValues_codec
= new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 18);
private readonly pbc::MapField<string, string> externalValues_ = new pbc::MapField<string, string>();
/// <summary>
/// Value names referenced by but external to this context.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, string> ExternalValues {
get { return externalValues_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ValuesDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ValuesDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!values_.Equals(other.values_)) return false;
if (!ExternalValues.Equals(other.ExternalValues)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= values_.GetHashCode();
hash ^= ExternalValues.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
values_.WriteTo(output, _repeated_values_codec);
externalValues_.WriteTo(output, _map_externalValues_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += values_.CalculateSize(_repeated_values_codec);
size += externalValues_.CalculateSize(_map_externalValues_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ValuesDef other) {
if (other == null) {
return;
}
values_.Add(other.values_);
externalValues_.Add(other.externalValues_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
values_.AddEntriesFrom(input, _repeated_values_codec);
break;
}
case 18: {
externalValues_.AddEntriesFrom(input, _map_externalValues_codec);
break;
}
}
}
}
}
/// <summary>
/// Protocol buffer representing a CondContext object.
/// </summary>
public sealed partial class CondContextDef : pb::IMessage<CondContextDef> {
private static readonly pb::MessageParser<CondContextDef> _parser = new pb::MessageParser<CondContextDef>(() => new CondContextDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CondContextDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.ControlFlowReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CondContextDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CondContextDef(CondContextDef other) : this() {
contextName_ = other.contextName_;
predName_ = other.predName_;
pivotName_ = other.pivotName_;
branch_ = other.branch_;
ValuesDef = other.valuesDef_ != null ? other.ValuesDef.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CondContextDef Clone() {
return new CondContextDef(this);
}
/// <summary>Field number for the "context_name" field.</summary>
public const int ContextNameFieldNumber = 1;
private string contextName_ = "";
/// <summary>
/// Name of the context.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ContextName {
get { return contextName_; }
set {
contextName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "pred_name" field.</summary>
public const int PredNameFieldNumber = 2;
private string predName_ = "";
/// <summary>
/// Name of the pred tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string PredName {
get { return predName_; }
set {
predName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "pivot_name" field.</summary>
public const int PivotNameFieldNumber = 3;
private string pivotName_ = "";
/// <summary>
/// Name of the pivot tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string PivotName {
get { return pivotName_; }
set {
pivotName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "branch" field.</summary>
public const int BranchFieldNumber = 4;
private int branch_;
/// <summary>
/// Branch prediction. 0 or 1.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Branch {
get { return branch_; }
set {
branch_ = value;
}
}
/// <summary>Field number for the "values_def" field.</summary>
public const int ValuesDefFieldNumber = 5;
private global::Tensorflow.ValuesDef valuesDef_;
/// <summary>
/// Values and external values in control flow context.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.ValuesDef ValuesDef {
get { return valuesDef_; }
set {
valuesDef_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as CondContextDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(CondContextDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ContextName != other.ContextName) return false;
if (PredName != other.PredName) return false;
if (PivotName != other.PivotName) return false;
if (Branch != other.Branch) return false;
if (!object.Equals(ValuesDef, other.ValuesDef)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ContextName.Length != 0) hash ^= ContextName.GetHashCode();
if (PredName.Length != 0) hash ^= PredName.GetHashCode();
if (PivotName.Length != 0) hash ^= PivotName.GetHashCode();
if (Branch != 0) hash ^= Branch.GetHashCode();
if (valuesDef_ != null) hash ^= ValuesDef.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ContextName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(ContextName);
}
if (PredName.Length != 0) {
output.WriteRawTag(18);
output.WriteString(PredName);
}
if (PivotName.Length != 0) {
output.WriteRawTag(26);
output.WriteString(PivotName);
}
if (Branch != 0) {
output.WriteRawTag(32);
output.WriteInt32(Branch);
}
if (valuesDef_ != null) {
output.WriteRawTag(42);
output.WriteMessage(ValuesDef);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ContextName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ContextName);
}
if (PredName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(PredName);
}
if (PivotName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(PivotName);
}
if (Branch != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Branch);
}
if (valuesDef_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ValuesDef);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(CondContextDef other) {
if (other == null) {
return;
}
if (other.ContextName.Length != 0) {
ContextName = other.ContextName;
}
if (other.PredName.Length != 0) {
PredName = other.PredName;
}
if (other.PivotName.Length != 0) {
PivotName = other.PivotName;
}
if (other.Branch != 0) {
Branch = other.Branch;
}
if (other.valuesDef_ != null) {
if (valuesDef_ == null) {
valuesDef_ = new global::Tensorflow.ValuesDef();
}
ValuesDef.MergeFrom(other.ValuesDef);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
ContextName = input.ReadString();
break;
}
case 18: {
PredName = input.ReadString();
break;
}
case 26: {
PivotName = input.ReadString();
break;
}
case 32: {
Branch = input.ReadInt32();
break;
}
case 42: {
if (valuesDef_ == null) {
valuesDef_ = new global::Tensorflow.ValuesDef();
}
input.ReadMessage(valuesDef_);
break;
}
}
}
}
}
/// <summary>
/// Protocol buffer representing a WhileContext object.
/// </summary>
public sealed partial class WhileContextDef : pb::IMessage<WhileContextDef> {
private static readonly pb::MessageParser<WhileContextDef> _parser = new pb::MessageParser<WhileContextDef>(() => new WhileContextDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<WhileContextDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.ControlFlowReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public WhileContextDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public WhileContextDef(WhileContextDef other) : this() {
contextName_ = other.contextName_;
parallelIterations_ = other.parallelIterations_;
backProp_ = other.backProp_;
swapMemory_ = other.swapMemory_;
pivotName_ = other.pivotName_;
pivotForPredName_ = other.pivotForPredName_;
pivotForBodyName_ = other.pivotForBodyName_;
loopExitNames_ = other.loopExitNames_.Clone();
loopEnterNames_ = other.loopEnterNames_.Clone();
ValuesDef = other.valuesDef_ != null ? other.ValuesDef.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public WhileContextDef Clone() {
return new WhileContextDef(this);
}
/// <summary>Field number for the "context_name" field.</summary>
public const int ContextNameFieldNumber = 1;
private string contextName_ = "";
/// <summary>
/// Name of the context.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ContextName {
get { return contextName_; }
set {
contextName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "parallel_iterations" field.</summary>
public const int ParallelIterationsFieldNumber = 2;
private int parallelIterations_;
/// <summary>
/// The number of iterations allowed to run in parallel.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ParallelIterations {
get { return parallelIterations_; }
set {
parallelIterations_ = value;
}
}
/// <summary>Field number for the "back_prop" field.</summary>
public const int BackPropFieldNumber = 3;
private bool backProp_;
/// <summary>
/// Whether backprop is enabled for this while loop.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool BackProp {
get { return backProp_; }
set {
backProp_ = value;
}
}
/// <summary>Field number for the "swap_memory" field.</summary>
public const int SwapMemoryFieldNumber = 4;
private bool swapMemory_;
/// <summary>
/// Whether GPU-CPU memory swap is enabled for this loop.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool SwapMemory {
get { return swapMemory_; }
set {
swapMemory_ = value;
}
}
/// <summary>Field number for the "pivot_name" field.</summary>
public const int PivotNameFieldNumber = 5;
private string pivotName_ = "";
/// <summary>
/// Name of the pivot tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string PivotName {
get { return pivotName_; }
set {
pivotName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "pivot_for_pred_name" field.</summary>
public const int PivotForPredNameFieldNumber = 6;
private string pivotForPredName_ = "";
/// <summary>
/// Name of the pivot_for_pred tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string PivotForPredName {
get { return pivotForPredName_; }
set {
pivotForPredName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "pivot_for_body_name" field.</summary>
public const int PivotForBodyNameFieldNumber = 7;
private string pivotForBodyName_ = "";
/// <summary>
/// Name of the pivot_for_body tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string PivotForBodyName {
get { return pivotForBodyName_; }
set {
pivotForBodyName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "loop_exit_names" field.</summary>
public const int LoopExitNamesFieldNumber = 8;
private static readonly pb::FieldCodec<string> _repeated_loopExitNames_codec
= pb::FieldCodec.ForString(66);
private readonly pbc::RepeatedField<string> loopExitNames_ = new pbc::RepeatedField<string>();
/// <summary>
/// List of names for exit tensors.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> LoopExitNames {
get { return loopExitNames_; }
}
/// <summary>Field number for the "loop_enter_names" field.</summary>
public const int LoopEnterNamesFieldNumber = 10;
private static readonly pb::FieldCodec<string> _repeated_loopEnterNames_codec
= pb::FieldCodec.ForString(82);
private readonly pbc::RepeatedField<string> loopEnterNames_ = new pbc::RepeatedField<string>();
/// <summary>
/// List of names for enter tensors.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> LoopEnterNames {
get { return loopEnterNames_; }
}
/// <summary>Field number for the "values_def" field.</summary>
public const int ValuesDefFieldNumber = 9;
private global::Tensorflow.ValuesDef valuesDef_;
/// <summary>
/// Values and external values in control flow context.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.ValuesDef ValuesDef {
get { return valuesDef_; }
set {
valuesDef_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as WhileContextDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(WhileContextDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ContextName != other.ContextName) return false;
if (ParallelIterations != other.ParallelIterations) return false;
if (BackProp != other.BackProp) return false;
if (SwapMemory != other.SwapMemory) return false;
if (PivotName != other.PivotName) return false;
if (PivotForPredName != other.PivotForPredName) return false;
if (PivotForBodyName != other.PivotForBodyName) return false;
if(!loopExitNames_.Equals(other.loopExitNames_)) return false;
if(!loopEnterNames_.Equals(other.loopEnterNames_)) return false;
if (!object.Equals(ValuesDef, other.ValuesDef)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ContextName.Length != 0) hash ^= ContextName.GetHashCode();
if (ParallelIterations != 0) hash ^= ParallelIterations.GetHashCode();
if (BackProp != false) hash ^= BackProp.GetHashCode();
if (SwapMemory != false) hash ^= SwapMemory.GetHashCode();
if (PivotName.Length != 0) hash ^= PivotName.GetHashCode();
if (PivotForPredName.Length != 0) hash ^= PivotForPredName.GetHashCode();
if (PivotForBodyName.Length != 0) hash ^= PivotForBodyName.GetHashCode();
hash ^= loopExitNames_.GetHashCode();
hash ^= loopEnterNames_.GetHashCode();
if (valuesDef_ != null) hash ^= ValuesDef.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ContextName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(ContextName);
}
if (ParallelIterations != 0) {
output.WriteRawTag(16);
output.WriteInt32(ParallelIterations);
}
if (BackProp != false) {
output.WriteRawTag(24);
output.WriteBool(BackProp);
}
if (SwapMemory != false) {
output.WriteRawTag(32);
output.WriteBool(SwapMemory);
}
if (PivotName.Length != 0) {
output.WriteRawTag(42);
output.WriteString(PivotName);
}
if (PivotForPredName.Length != 0) {
output.WriteRawTag(50);
output.WriteString(PivotForPredName);
}
if (PivotForBodyName.Length != 0) {
output.WriteRawTag(58);
output.WriteString(PivotForBodyName);
}
loopExitNames_.WriteTo(output, _repeated_loopExitNames_codec);
if (valuesDef_ != null) {
output.WriteRawTag(74);
output.WriteMessage(ValuesDef);
}
loopEnterNames_.WriteTo(output, _repeated_loopEnterNames_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ContextName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ContextName);
}
if (ParallelIterations != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ParallelIterations);
}
if (BackProp != false) {
size += 1 + 1;
}
if (SwapMemory != false) {
size += 1 + 1;
}
if (PivotName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(PivotName);
}
if (PivotForPredName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(PivotForPredName);
}
if (PivotForBodyName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(PivotForBodyName);
}
size += loopExitNames_.CalculateSize(_repeated_loopExitNames_codec);
size += loopEnterNames_.CalculateSize(_repeated_loopEnterNames_codec);
if (valuesDef_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ValuesDef);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(WhileContextDef other) {
if (other == null) {
return;
}
if (other.ContextName.Length != 0) {
ContextName = other.ContextName;
}
if (other.ParallelIterations != 0) {
ParallelIterations = other.ParallelIterations;
}
if (other.BackProp != false) {
BackProp = other.BackProp;
}
if (other.SwapMemory != false) {
SwapMemory = other.SwapMemory;
}
if (other.PivotName.Length != 0) {
PivotName = other.PivotName;
}
if (other.PivotForPredName.Length != 0) {
PivotForPredName = other.PivotForPredName;
}
if (other.PivotForBodyName.Length != 0) {
PivotForBodyName = other.PivotForBodyName;
}
loopExitNames_.Add(other.loopExitNames_);
loopEnterNames_.Add(other.loopEnterNames_);
if (other.valuesDef_ != null) {
if (valuesDef_ == null) {
valuesDef_ = new global::Tensorflow.ValuesDef();
}
ValuesDef.MergeFrom(other.ValuesDef);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
ContextName = input.ReadString();
break;
}
case 16: {
ParallelIterations = input.ReadInt32();
break;
}
case 24: {
BackProp = input.ReadBool();
break;
}
case 32: {
SwapMemory = input.ReadBool();
break;
}
case 42: {
PivotName = input.ReadString();
break;
}
case 50: {
PivotForPredName = input.ReadString();
break;
}
case 58: {
PivotForBodyName = input.ReadString();
break;
}
case 66: {
loopExitNames_.AddEntriesFrom(input, _repeated_loopExitNames_codec);
break;
}
case 74: {
if (valuesDef_ == null) {
valuesDef_ = new global::Tensorflow.ValuesDef();
}
input.ReadMessage(valuesDef_);
break;
}
case 82: {
loopEnterNames_.AddEntriesFrom(input, _repeated_loopEnterNames_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,453 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/debug.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/debug.proto</summary>
public static partial class DebugReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/debug.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static DebugReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiR0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvZGVidWcucHJvdG8SCnRlbnNv",
"cmZsb3cijgEKEERlYnVnVGVuc29yV2F0Y2gSEQoJbm9kZV9uYW1lGAEgASgJ",
"EhMKC291dHB1dF9zbG90GAIgASgFEhEKCWRlYnVnX29wcxgDIAMoCRISCgpk",
"ZWJ1Z191cmxzGAQgAygJEisKI3RvbGVyYXRlX2RlYnVnX29wX2NyZWF0aW9u",
"X2ZhaWx1cmVzGAUgASgIImIKDERlYnVnT3B0aW9ucxI9ChdkZWJ1Z190ZW5z",
"b3Jfd2F0Y2hfb3B0cxgEIAMoCzIcLnRlbnNvcmZsb3cuRGVidWdUZW5zb3JX",
"YXRjaBITCgtnbG9iYWxfc3RlcBgKIAEoA0IsChhvcmcudGVuc29yZmxvdy5m",
"cmFtZXdvcmtCC0RlYnVnUHJvdG9zUAH4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DebugTensorWatch), global::Tensorflow.DebugTensorWatch.Parser, new[]{ "NodeName", "OutputSlot", "DebugOps", "DebugUrls", "TolerateDebugOpCreationFailures" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DebugOptions), global::Tensorflow.DebugOptions.Parser, new[]{ "DebugTensorWatchOpts", "GlobalStep" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// EXPERIMENTAL. Option for watching a node.
/// </summary>
public sealed partial class DebugTensorWatch : pb::IMessage<DebugTensorWatch> {
private static readonly pb::MessageParser<DebugTensorWatch> _parser = new pb::MessageParser<DebugTensorWatch>(() => new DebugTensorWatch());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DebugTensorWatch> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.DebugReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DebugTensorWatch() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DebugTensorWatch(DebugTensorWatch other) : this() {
nodeName_ = other.nodeName_;
outputSlot_ = other.outputSlot_;
debugOps_ = other.debugOps_.Clone();
debugUrls_ = other.debugUrls_.Clone();
tolerateDebugOpCreationFailures_ = other.tolerateDebugOpCreationFailures_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DebugTensorWatch Clone() {
return new DebugTensorWatch(this);
}
/// <summary>Field number for the "node_name" field.</summary>
public const int NodeNameFieldNumber = 1;
private string nodeName_ = "";
/// <summary>
/// Name of the node to watch.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string NodeName {
get { return nodeName_; }
set {
nodeName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "output_slot" field.</summary>
public const int OutputSlotFieldNumber = 2;
private int outputSlot_;
/// <summary>
/// Output slot to watch.
/// The semantics of output_slot == -1 is that the node is only watched for
/// completion, but not for any output tensors. See NodeCompletionCallback
/// in debug_gateway.h.
/// TODO(cais): Implement this semantics.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int OutputSlot {
get { return outputSlot_; }
set {
outputSlot_ = value;
}
}
/// <summary>Field number for the "debug_ops" field.</summary>
public const int DebugOpsFieldNumber = 3;
private static readonly pb::FieldCodec<string> _repeated_debugOps_codec
= pb::FieldCodec.ForString(26);
private readonly pbc::RepeatedField<string> debugOps_ = new pbc::RepeatedField<string>();
/// <summary>
/// Name(s) of the debugging op(s).
/// One or more than one probes on a tensor.
/// e.g., {"DebugIdentity", "DebugNanCount"}
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> DebugOps {
get { return debugOps_; }
}
/// <summary>Field number for the "debug_urls" field.</summary>
public const int DebugUrlsFieldNumber = 4;
private static readonly pb::FieldCodec<string> _repeated_debugUrls_codec
= pb::FieldCodec.ForString(34);
private readonly pbc::RepeatedField<string> debugUrls_ = new pbc::RepeatedField<string>();
/// <summary>
/// URL(s) for debug targets(s).
///
/// Supported URL formats are:
/// - file:///foo/tfdbg_dump: Writes out Event content to file
/// /foo/tfdbg_dump. Assumes all directories can be created if they don't
/// already exist.
/// - grpc://localhost:11011: Sends an RPC request to an EventListener
/// service running at localhost:11011 with the event.
/// - memcbk:///event_key: Routes tensors to clients using the
/// callback registered with the DebugCallbackRegistry for event_key.
///
/// Each debug op listed in debug_ops will publish its output tensor (debug
/// signal) to all URLs in debug_urls.
///
/// N.B. Session::Run() supports concurrent invocations of the same inputs
/// (feed keys), outputs and target nodes. If such concurrent invocations
/// are to be debugged, the callers of Session::Run() must use distinct
/// debug_urls to make sure that the streamed or dumped events do not overlap
/// among the invocations.
/// TODO(cais): More visible documentation of this in g3docs.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> DebugUrls {
get { return debugUrls_; }
}
/// <summary>Field number for the "tolerate_debug_op_creation_failures" field.</summary>
public const int TolerateDebugOpCreationFailuresFieldNumber = 5;
private bool tolerateDebugOpCreationFailures_;
/// <summary>
/// Do not error out if debug op creation fails (e.g., due to dtype
/// incompatibility). Instead, just log the failure.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool TolerateDebugOpCreationFailures {
get { return tolerateDebugOpCreationFailures_; }
set {
tolerateDebugOpCreationFailures_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DebugTensorWatch);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DebugTensorWatch other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (NodeName != other.NodeName) return false;
if (OutputSlot != other.OutputSlot) return false;
if(!debugOps_.Equals(other.debugOps_)) return false;
if(!debugUrls_.Equals(other.debugUrls_)) return false;
if (TolerateDebugOpCreationFailures != other.TolerateDebugOpCreationFailures) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (NodeName.Length != 0) hash ^= NodeName.GetHashCode();
if (OutputSlot != 0) hash ^= OutputSlot.GetHashCode();
hash ^= debugOps_.GetHashCode();
hash ^= debugUrls_.GetHashCode();
if (TolerateDebugOpCreationFailures != false) hash ^= TolerateDebugOpCreationFailures.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (NodeName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(NodeName);
}
if (OutputSlot != 0) {
output.WriteRawTag(16);
output.WriteInt32(OutputSlot);
}
debugOps_.WriteTo(output, _repeated_debugOps_codec);
debugUrls_.WriteTo(output, _repeated_debugUrls_codec);
if (TolerateDebugOpCreationFailures != false) {
output.WriteRawTag(40);
output.WriteBool(TolerateDebugOpCreationFailures);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (NodeName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(NodeName);
}
if (OutputSlot != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputSlot);
}
size += debugOps_.CalculateSize(_repeated_debugOps_codec);
size += debugUrls_.CalculateSize(_repeated_debugUrls_codec);
if (TolerateDebugOpCreationFailures != false) {
size += 1 + 1;
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DebugTensorWatch other) {
if (other == null) {
return;
}
if (other.NodeName.Length != 0) {
NodeName = other.NodeName;
}
if (other.OutputSlot != 0) {
OutputSlot = other.OutputSlot;
}
debugOps_.Add(other.debugOps_);
debugUrls_.Add(other.debugUrls_);
if (other.TolerateDebugOpCreationFailures != false) {
TolerateDebugOpCreationFailures = other.TolerateDebugOpCreationFailures;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
NodeName = input.ReadString();
break;
}
case 16: {
OutputSlot = input.ReadInt32();
break;
}
case 26: {
debugOps_.AddEntriesFrom(input, _repeated_debugOps_codec);
break;
}
case 34: {
debugUrls_.AddEntriesFrom(input, _repeated_debugUrls_codec);
break;
}
case 40: {
TolerateDebugOpCreationFailures = input.ReadBool();
break;
}
}
}
}
}
/// <summary>
/// EXPERIMENTAL. Options for initializing DebuggerState.
/// </summary>
public sealed partial class DebugOptions : pb::IMessage<DebugOptions> {
private static readonly pb::MessageParser<DebugOptions> _parser = new pb::MessageParser<DebugOptions>(() => new DebugOptions());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DebugOptions> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.DebugReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DebugOptions() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DebugOptions(DebugOptions other) : this() {
debugTensorWatchOpts_ = other.debugTensorWatchOpts_.Clone();
globalStep_ = other.globalStep_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DebugOptions Clone() {
return new DebugOptions(this);
}
/// <summary>Field number for the "debug_tensor_watch_opts" field.</summary>
public const int DebugTensorWatchOptsFieldNumber = 4;
private static readonly pb::FieldCodec<global::Tensorflow.DebugTensorWatch> _repeated_debugTensorWatchOpts_codec
= pb::FieldCodec.ForMessage(34, global::Tensorflow.DebugTensorWatch.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.DebugTensorWatch> debugTensorWatchOpts_ = new pbc::RepeatedField<global::Tensorflow.DebugTensorWatch>();
/// <summary>
/// Debugging options
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.DebugTensorWatch> DebugTensorWatchOpts {
get { return debugTensorWatchOpts_; }
}
/// <summary>Field number for the "global_step" field.</summary>
public const int GlobalStepFieldNumber = 10;
private long globalStep_;
/// <summary>
/// Caller-specified global step count.
/// Note that this is distinct from the session run count and the executor
/// step count.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long GlobalStep {
get { return globalStep_; }
set {
globalStep_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DebugOptions);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DebugOptions other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!debugTensorWatchOpts_.Equals(other.debugTensorWatchOpts_)) return false;
if (GlobalStep != other.GlobalStep) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= debugTensorWatchOpts_.GetHashCode();
if (GlobalStep != 0L) hash ^= GlobalStep.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
debugTensorWatchOpts_.WriteTo(output, _repeated_debugTensorWatchOpts_codec);
if (GlobalStep != 0L) {
output.WriteRawTag(80);
output.WriteInt64(GlobalStep);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += debugTensorWatchOpts_.CalculateSize(_repeated_debugTensorWatchOpts_codec);
if (GlobalStep != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(GlobalStep);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DebugOptions other) {
if (other == null) {
return;
}
debugTensorWatchOpts_.Add(other.debugTensorWatchOpts_);
if (other.GlobalStep != 0L) {
GlobalStep = other.GlobalStep;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 34: {
debugTensorWatchOpts_.AddEntriesFrom(input, _repeated_debugTensorWatchOpts_codec);
break;
}
case 80: {
GlobalStep = input.ReadInt64();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,452 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/device_attributes.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/device_attributes.proto</summary>
public static partial class DeviceAttributesReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/device_attributes.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static DeviceAttributesReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjF0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2RldmljZV9hdHRyaWJ1dGVz",
"LnByb3RvEgp0ZW5zb3JmbG93IiAKDkRldmljZUxvY2FsaXR5Eg4KBmJ1c19p",
"ZBgBIAEoBSKsAQoQRGV2aWNlQXR0cmlidXRlcxIMCgRuYW1lGAEgASgJEhMK",
"C2RldmljZV90eXBlGAIgASgJEhQKDG1lbW9yeV9saW1pdBgEIAEoAxIsCghs",
"b2NhbGl0eRgFIAEoCzIaLnRlbnNvcmZsb3cuRGV2aWNlTG9jYWxpdHkSEwoL",
"aW5jYXJuYXRpb24YBiABKAYSHAoUcGh5c2ljYWxfZGV2aWNlX2Rlc2MYByAB",
"KAlCNwoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQhZEZXZpY2VBdHRyaWJ1",
"dGVzUHJvdG9zUAH4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DeviceLocality), global::Tensorflow.DeviceLocality.Parser, new[]{ "BusId" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DeviceAttributes), global::Tensorflow.DeviceAttributes.Parser, new[]{ "Name", "DeviceType", "MemoryLimit", "Locality", "Incarnation", "PhysicalDeviceDesc" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class DeviceLocality : pb::IMessage<DeviceLocality> {
private static readonly pb::MessageParser<DeviceLocality> _parser = new pb::MessageParser<DeviceLocality>(() => new DeviceLocality());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DeviceLocality> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.DeviceAttributesReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeviceLocality() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeviceLocality(DeviceLocality other) : this() {
busId_ = other.busId_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeviceLocality Clone() {
return new DeviceLocality(this);
}
/// <summary>Field number for the "bus_id" field.</summary>
public const int BusIdFieldNumber = 1;
private int busId_;
/// <summary>
/// Optional bus locality of device. Default value of 0 means
/// no specific locality. Specific localities are indexed from 1.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int BusId {
get { return busId_; }
set {
busId_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DeviceLocality);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DeviceLocality other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (BusId != other.BusId) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (BusId != 0) hash ^= BusId.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (BusId != 0) {
output.WriteRawTag(8);
output.WriteInt32(BusId);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (BusId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(BusId);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DeviceLocality other) {
if (other == null) {
return;
}
if (other.BusId != 0) {
BusId = other.BusId;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
BusId = input.ReadInt32();
break;
}
}
}
}
}
public sealed partial class DeviceAttributes : pb::IMessage<DeviceAttributes> {
private static readonly pb::MessageParser<DeviceAttributes> _parser = new pb::MessageParser<DeviceAttributes>(() => new DeviceAttributes());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DeviceAttributes> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.DeviceAttributesReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeviceAttributes() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeviceAttributes(DeviceAttributes other) : this() {
name_ = other.name_;
deviceType_ = other.deviceType_;
memoryLimit_ = other.memoryLimit_;
Locality = other.locality_ != null ? other.Locality.Clone() : null;
incarnation_ = other.incarnation_;
physicalDeviceDesc_ = other.physicalDeviceDesc_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeviceAttributes Clone() {
return new DeviceAttributes(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Fully specified name of the device within a cluster.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "device_type" field.</summary>
public const int DeviceTypeFieldNumber = 2;
private string deviceType_ = "";
/// <summary>
/// String representation of device_type.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DeviceType {
get { return deviceType_; }
set {
deviceType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "memory_limit" field.</summary>
public const int MemoryLimitFieldNumber = 4;
private long memoryLimit_;
/// <summary>
/// Memory capacity of device in bytes.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long MemoryLimit {
get { return memoryLimit_; }
set {
memoryLimit_ = value;
}
}
/// <summary>Field number for the "locality" field.</summary>
public const int LocalityFieldNumber = 5;
private global::Tensorflow.DeviceLocality locality_;
/// <summary>
/// Platform-specific data about device that may be useful
/// for supporting efficient data transfers.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.DeviceLocality Locality {
get { return locality_; }
set {
locality_ = value;
}
}
/// <summary>Field number for the "incarnation" field.</summary>
public const int IncarnationFieldNumber = 6;
private ulong incarnation_;
/// <summary>
/// A device is assigned a global unique number each time it is
/// initialized. "incarnation" should never be 0.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ulong Incarnation {
get { return incarnation_; }
set {
incarnation_ = value;
}
}
/// <summary>Field number for the "physical_device_desc" field.</summary>
public const int PhysicalDeviceDescFieldNumber = 7;
private string physicalDeviceDesc_ = "";
/// <summary>
/// String representation of the physical device that this device maps to.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string PhysicalDeviceDesc {
get { return physicalDeviceDesc_; }
set {
physicalDeviceDesc_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DeviceAttributes);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DeviceAttributes other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (DeviceType != other.DeviceType) return false;
if (MemoryLimit != other.MemoryLimit) return false;
if (!object.Equals(Locality, other.Locality)) return false;
if (Incarnation != other.Incarnation) return false;
if (PhysicalDeviceDesc != other.PhysicalDeviceDesc) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (DeviceType.Length != 0) hash ^= DeviceType.GetHashCode();
if (MemoryLimit != 0L) hash ^= MemoryLimit.GetHashCode();
if (locality_ != null) hash ^= Locality.GetHashCode();
if (Incarnation != 0UL) hash ^= Incarnation.GetHashCode();
if (PhysicalDeviceDesc.Length != 0) hash ^= PhysicalDeviceDesc.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (DeviceType.Length != 0) {
output.WriteRawTag(18);
output.WriteString(DeviceType);
}
if (MemoryLimit != 0L) {
output.WriteRawTag(32);
output.WriteInt64(MemoryLimit);
}
if (locality_ != null) {
output.WriteRawTag(42);
output.WriteMessage(Locality);
}
if (Incarnation != 0UL) {
output.WriteRawTag(49);
output.WriteFixed64(Incarnation);
}
if (PhysicalDeviceDesc.Length != 0) {
output.WriteRawTag(58);
output.WriteString(PhysicalDeviceDesc);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (DeviceType.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(DeviceType);
}
if (MemoryLimit != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(MemoryLimit);
}
if (locality_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Locality);
}
if (Incarnation != 0UL) {
size += 1 + 8;
}
if (PhysicalDeviceDesc.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(PhysicalDeviceDesc);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DeviceAttributes other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.DeviceType.Length != 0) {
DeviceType = other.DeviceType;
}
if (other.MemoryLimit != 0L) {
MemoryLimit = other.MemoryLimit;
}
if (other.locality_ != null) {
if (locality_ == null) {
locality_ = new global::Tensorflow.DeviceLocality();
}
Locality.MergeFrom(other.Locality);
}
if (other.Incarnation != 0UL) {
Incarnation = other.Incarnation;
}
if (other.PhysicalDeviceDesc.Length != 0) {
PhysicalDeviceDesc = other.PhysicalDeviceDesc;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
DeviceType = input.ReadString();
break;
}
case 32: {
MemoryLimit = input.ReadInt64();
break;
}
case 42: {
if (locality_ == null) {
locality_ = new global::Tensorflow.DeviceLocality();
}
input.ReadMessage(locality_);
break;
}
case 49: {
Incarnation = input.ReadFixed64();
break;
}
case 58: {
PhysicalDeviceDesc = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,537 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/device_properties.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/device_properties.proto</summary>
public static partial class DevicePropertiesReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/device_properties.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static DevicePropertiesReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjB0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvZGV2aWNlX3Byb3BlcnRpZXMu",
"cHJvdG8SCnRlbnNvcmZsb3cikAMKEERldmljZVByb3BlcnRpZXMSDAoEdHlw",
"ZRgBIAEoCRIOCgZ2ZW5kb3IYAiABKAkSDQoFbW9kZWwYAyABKAkSEQoJZnJl",
"cXVlbmN5GAQgASgDEhEKCW51bV9jb3JlcxgFIAEoAxJCCgtlbnZpcm9ubWVu",
"dBgGIAMoCzItLnRlbnNvcmZsb3cuRGV2aWNlUHJvcGVydGllcy5FbnZpcm9u",
"bWVudEVudHJ5EhUKDW51bV9yZWdpc3RlcnMYByABKAMSFQoNbDFfY2FjaGVf",
"c2l6ZRgIIAEoAxIVCg1sMl9jYWNoZV9zaXplGAkgASgDEhUKDWwzX2NhY2hl",
"X3NpemUYCiABKAMSLQolc2hhcmVkX21lbW9yeV9zaXplX3Blcl9tdWx0aXBy",
"b2Nlc3NvchgLIAEoAxITCgttZW1vcnlfc2l6ZRgMIAEoAxIRCgliYW5kd2lk",
"dGgYDSABKAMaMgoQRW52aXJvbm1lbnRFbnRyeRILCgNrZXkYASABKAkSDQoF",
"dmFsdWUYAiABKAk6AjgBQhtCFkRldmljZVByb3BlcnRpZXNQcm90b3P4AQFi",
"BnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DeviceProperties), global::Tensorflow.DeviceProperties.Parser, new[]{ "Type", "Vendor", "Model", "Frequency", "NumCores", "Environment", "NumRegisters", "L1CacheSize", "L2CacheSize", "L3CacheSize", "SharedMemorySizePerMultiprocessor", "MemorySize", "Bandwidth" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
}));
}
#endregion
}
#region Messages
public sealed partial class DeviceProperties : pb::IMessage<DeviceProperties> {
private static readonly pb::MessageParser<DeviceProperties> _parser = new pb::MessageParser<DeviceProperties>(() => new DeviceProperties());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DeviceProperties> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.DevicePropertiesReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeviceProperties() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeviceProperties(DeviceProperties other) : this() {
type_ = other.type_;
vendor_ = other.vendor_;
model_ = other.model_;
frequency_ = other.frequency_;
numCores_ = other.numCores_;
environment_ = other.environment_.Clone();
numRegisters_ = other.numRegisters_;
l1CacheSize_ = other.l1CacheSize_;
l2CacheSize_ = other.l2CacheSize_;
l3CacheSize_ = other.l3CacheSize_;
sharedMemorySizePerMultiprocessor_ = other.sharedMemorySizePerMultiprocessor_;
memorySize_ = other.memorySize_;
bandwidth_ = other.bandwidth_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeviceProperties Clone() {
return new DeviceProperties(this);
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 1;
private string type_ = "";
/// <summary>
/// Device type (CPU, GPU, ...)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Type {
get { return type_; }
set {
type_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "vendor" field.</summary>
public const int VendorFieldNumber = 2;
private string vendor_ = "";
/// <summary>
/// Vendor (Intel, nvidia, ...)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Vendor {
get { return vendor_; }
set {
vendor_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "model" field.</summary>
public const int ModelFieldNumber = 3;
private string model_ = "";
/// <summary>
/// Model (Haswell, K40, ...)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Model {
get { return model_; }
set {
model_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "frequency" field.</summary>
public const int FrequencyFieldNumber = 4;
private long frequency_;
/// <summary>
/// Core Frequency in Mhz
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Frequency {
get { return frequency_; }
set {
frequency_ = value;
}
}
/// <summary>Field number for the "num_cores" field.</summary>
public const int NumCoresFieldNumber = 5;
private long numCores_;
/// <summary>
/// Number of cores
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long NumCores {
get { return numCores_; }
set {
numCores_ = value;
}
}
/// <summary>Field number for the "environment" field.</summary>
public const int EnvironmentFieldNumber = 6;
private static readonly pbc::MapField<string, string>.Codec _map_environment_codec
= new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 50);
private readonly pbc::MapField<string, string> environment_ = new pbc::MapField<string, string>();
/// <summary>
/// Version of the tools and libraries used with this device (e.g. gcc 4.9,
/// cudnn 5.1)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, string> Environment {
get { return environment_; }
}
/// <summary>Field number for the "num_registers" field.</summary>
public const int NumRegistersFieldNumber = 7;
private long numRegisters_;
/// <summary>
/// Number of registers per core.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long NumRegisters {
get { return numRegisters_; }
set {
numRegisters_ = value;
}
}
/// <summary>Field number for the "l1_cache_size" field.</summary>
public const int L1CacheSizeFieldNumber = 8;
private long l1CacheSize_;
/// <summary>
/// L1 cache size in bytes
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long L1CacheSize {
get { return l1CacheSize_; }
set {
l1CacheSize_ = value;
}
}
/// <summary>Field number for the "l2_cache_size" field.</summary>
public const int L2CacheSizeFieldNumber = 9;
private long l2CacheSize_;
/// <summary>
/// L2 cache size in bytes
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long L2CacheSize {
get { return l2CacheSize_; }
set {
l2CacheSize_ = value;
}
}
/// <summary>Field number for the "l3_cache_size" field.</summary>
public const int L3CacheSizeFieldNumber = 10;
private long l3CacheSize_;
/// <summary>
/// L3 cache size in bytes
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long L3CacheSize {
get { return l3CacheSize_; }
set {
l3CacheSize_ = value;
}
}
/// <summary>Field number for the "shared_memory_size_per_multiprocessor" field.</summary>
public const int SharedMemorySizePerMultiprocessorFieldNumber = 11;
private long sharedMemorySizePerMultiprocessor_;
/// <summary>
/// Shared memory size per multiprocessor in bytes. This field is
/// applicable to GPUs only.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long SharedMemorySizePerMultiprocessor {
get { return sharedMemorySizePerMultiprocessor_; }
set {
sharedMemorySizePerMultiprocessor_ = value;
}
}
/// <summary>Field number for the "memory_size" field.</summary>
public const int MemorySizeFieldNumber = 12;
private long memorySize_;
/// <summary>
/// Memory size in bytes
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long MemorySize {
get { return memorySize_; }
set {
memorySize_ = value;
}
}
/// <summary>Field number for the "bandwidth" field.</summary>
public const int BandwidthFieldNumber = 13;
private long bandwidth_;
/// <summary>
/// Memory bandwidth in KB/s
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Bandwidth {
get { return bandwidth_; }
set {
bandwidth_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DeviceProperties);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DeviceProperties other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Type != other.Type) return false;
if (Vendor != other.Vendor) return false;
if (Model != other.Model) return false;
if (Frequency != other.Frequency) return false;
if (NumCores != other.NumCores) return false;
if (!Environment.Equals(other.Environment)) return false;
if (NumRegisters != other.NumRegisters) return false;
if (L1CacheSize != other.L1CacheSize) return false;
if (L2CacheSize != other.L2CacheSize) return false;
if (L3CacheSize != other.L3CacheSize) return false;
if (SharedMemorySizePerMultiprocessor != other.SharedMemorySizePerMultiprocessor) return false;
if (MemorySize != other.MemorySize) return false;
if (Bandwidth != other.Bandwidth) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Type.Length != 0) hash ^= Type.GetHashCode();
if (Vendor.Length != 0) hash ^= Vendor.GetHashCode();
if (Model.Length != 0) hash ^= Model.GetHashCode();
if (Frequency != 0L) hash ^= Frequency.GetHashCode();
if (NumCores != 0L) hash ^= NumCores.GetHashCode();
hash ^= Environment.GetHashCode();
if (NumRegisters != 0L) hash ^= NumRegisters.GetHashCode();
if (L1CacheSize != 0L) hash ^= L1CacheSize.GetHashCode();
if (L2CacheSize != 0L) hash ^= L2CacheSize.GetHashCode();
if (L3CacheSize != 0L) hash ^= L3CacheSize.GetHashCode();
if (SharedMemorySizePerMultiprocessor != 0L) hash ^= SharedMemorySizePerMultiprocessor.GetHashCode();
if (MemorySize != 0L) hash ^= MemorySize.GetHashCode();
if (Bandwidth != 0L) hash ^= Bandwidth.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Type.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Type);
}
if (Vendor.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Vendor);
}
if (Model.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Model);
}
if (Frequency != 0L) {
output.WriteRawTag(32);
output.WriteInt64(Frequency);
}
if (NumCores != 0L) {
output.WriteRawTag(40);
output.WriteInt64(NumCores);
}
environment_.WriteTo(output, _map_environment_codec);
if (NumRegisters != 0L) {
output.WriteRawTag(56);
output.WriteInt64(NumRegisters);
}
if (L1CacheSize != 0L) {
output.WriteRawTag(64);
output.WriteInt64(L1CacheSize);
}
if (L2CacheSize != 0L) {
output.WriteRawTag(72);
output.WriteInt64(L2CacheSize);
}
if (L3CacheSize != 0L) {
output.WriteRawTag(80);
output.WriteInt64(L3CacheSize);
}
if (SharedMemorySizePerMultiprocessor != 0L) {
output.WriteRawTag(88);
output.WriteInt64(SharedMemorySizePerMultiprocessor);
}
if (MemorySize != 0L) {
output.WriteRawTag(96);
output.WriteInt64(MemorySize);
}
if (Bandwidth != 0L) {
output.WriteRawTag(104);
output.WriteInt64(Bandwidth);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Type.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Type);
}
if (Vendor.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Vendor);
}
if (Model.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Model);
}
if (Frequency != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Frequency);
}
if (NumCores != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(NumCores);
}
size += environment_.CalculateSize(_map_environment_codec);
if (NumRegisters != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(NumRegisters);
}
if (L1CacheSize != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(L1CacheSize);
}
if (L2CacheSize != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(L2CacheSize);
}
if (L3CacheSize != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(L3CacheSize);
}
if (SharedMemorySizePerMultiprocessor != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(SharedMemorySizePerMultiprocessor);
}
if (MemorySize != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(MemorySize);
}
if (Bandwidth != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Bandwidth);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DeviceProperties other) {
if (other == null) {
return;
}
if (other.Type.Length != 0) {
Type = other.Type;
}
if (other.Vendor.Length != 0) {
Vendor = other.Vendor;
}
if (other.Model.Length != 0) {
Model = other.Model;
}
if (other.Frequency != 0L) {
Frequency = other.Frequency;
}
if (other.NumCores != 0L) {
NumCores = other.NumCores;
}
environment_.Add(other.environment_);
if (other.NumRegisters != 0L) {
NumRegisters = other.NumRegisters;
}
if (other.L1CacheSize != 0L) {
L1CacheSize = other.L1CacheSize;
}
if (other.L2CacheSize != 0L) {
L2CacheSize = other.L2CacheSize;
}
if (other.L3CacheSize != 0L) {
L3CacheSize = other.L3CacheSize;
}
if (other.SharedMemorySizePerMultiprocessor != 0L) {
SharedMemorySizePerMultiprocessor = other.SharedMemorySizePerMultiprocessor;
}
if (other.MemorySize != 0L) {
MemorySize = other.MemorySize;
}
if (other.Bandwidth != 0L) {
Bandwidth = other.Bandwidth;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Type = input.ReadString();
break;
}
case 18: {
Vendor = input.ReadString();
break;
}
case 26: {
Model = input.ReadString();
break;
}
case 32: {
Frequency = input.ReadInt64();
break;
}
case 40: {
NumCores = input.ReadInt64();
break;
}
case 50: {
environment_.AddEntriesFrom(input, _map_environment_codec);
break;
}
case 56: {
NumRegisters = input.ReadInt64();
break;
}
case 64: {
L1CacheSize = input.ReadInt64();
break;
}
case 72: {
L2CacheSize = input.ReadInt64();
break;
}
case 80: {
L3CacheSize = input.ReadInt64();
break;
}
case 88: {
SharedMemorySizePerMultiprocessor = input.ReadInt64();
break;
}
case 96: {
MemorySize = input.ReadInt64();
break;
}
case 104: {
Bandwidth = input.ReadInt64();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,211 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/lib/core/error_codes.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Error {
/// <summary>Holder for reflection information generated from tensorflow/core/lib/core/error_codes.proto</summary>
public static partial class ErrorCodesReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/lib/core/error_codes.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ErrorCodesReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cip0ZW5zb3JmbG93L2NvcmUvbGliL2NvcmUvZXJyb3JfY29kZXMucHJvdG8S",
"EHRlbnNvcmZsb3cuZXJyb3IqhAMKBENvZGUSBgoCT0sQABINCglDQU5DRUxM",
"RUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURF",
"QURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9F",
"WElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElD",
"QVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVD",
"T05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoN",
"VU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQ",
"DhINCglEQVRBX0xPU1MQDxJLCkdET19OT1RfVVNFX1JFU0VSVkVEX0ZPUl9G",
"VVRVUkVfRVhQQU5TSU9OX1VTRV9ERUZBVUxUX0lOX1NXSVRDSF9JTlNURUFE",
"XxAUQjEKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IQRXJyb3JDb2Rlc1By",
"b3Rvc1AB+AEBYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tensorflow.Error.Code), }, null));
}
#endregion
}
#region Enums
/// <summary>
/// The canonical error codes for TensorFlow APIs.
///
/// Warnings:
///
/// - Do not change any numeric assignments.
/// - Changes to this list should only be made if there is a compelling
/// need that can't be satisfied in another way. Such changes
/// must be approved by at least two OWNERS.
///
/// Sometimes multiple error codes may apply. Services should return
/// the most specific error code that applies. For example, prefer
/// OUT_OF_RANGE over FAILED_PRECONDITION if both codes apply.
/// Similarly prefer NOT_FOUND or ALREADY_EXISTS over FAILED_PRECONDITION.
/// </summary>
public enum Code {
/// <summary>
/// Not an error; returned on success
/// </summary>
[pbr::OriginalName("OK")] Ok = 0,
/// <summary>
/// The operation was cancelled (typically by the caller).
/// </summary>
[pbr::OriginalName("CANCELLED")] Cancelled = 1,
/// <summary>
/// Unknown error. An example of where this error may be returned is
/// if a Status value received from another address space belongs to
/// an error-space that is not known in this address space. Also
/// errors raised by APIs that do not return enough error information
/// may be converted to this error.
/// </summary>
[pbr::OriginalName("UNKNOWN")] Unknown = 2,
/// <summary>
/// Client specified an invalid argument. Note that this differs
/// from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments
/// that are problematic regardless of the state of the system
/// (e.g., a malformed file name).
/// </summary>
[pbr::OriginalName("INVALID_ARGUMENT")] InvalidArgument = 3,
/// <summary>
/// Deadline expired before operation could complete. For operations
/// that change the state of the system, this error may be returned
/// even if the operation has completed successfully. For example, a
/// successful response from a server could have been delayed long
/// enough for the deadline to expire.
/// </summary>
[pbr::OriginalName("DEADLINE_EXCEEDED")] DeadlineExceeded = 4,
/// <summary>
/// Some requested entity (e.g., file or directory) was not found.
/// For privacy reasons, this code *may* be returned when the client
/// does not have the access right to the entity.
/// </summary>
[pbr::OriginalName("NOT_FOUND")] NotFound = 5,
/// <summary>
/// Some entity that we attempted to create (e.g., file or directory)
/// already exists.
/// </summary>
[pbr::OriginalName("ALREADY_EXISTS")] AlreadyExists = 6,
/// <summary>
/// The caller does not have permission to execute the specified
/// operation. PERMISSION_DENIED must not be used for rejections
/// caused by exhausting some resource (use RESOURCE_EXHAUSTED
/// instead for those errors). PERMISSION_DENIED must not be
/// used if the caller can not be identified (use UNAUTHENTICATED
/// instead for those errors).
/// </summary>
[pbr::OriginalName("PERMISSION_DENIED")] PermissionDenied = 7,
/// <summary>
/// The request does not have valid authentication credentials for the
/// operation.
/// </summary>
[pbr::OriginalName("UNAUTHENTICATED")] Unauthenticated = 16,
/// <summary>
/// Some resource has been exhausted, perhaps a per-user quota, or
/// perhaps the entire file system is out of space.
/// </summary>
[pbr::OriginalName("RESOURCE_EXHAUSTED")] ResourceExhausted = 8,
/// <summary>
/// Operation was rejected because the system is not in a state
/// required for the operation's execution. For example, directory
/// to be deleted may be non-empty, an rmdir operation is applied to
/// a non-directory, etc.
///
/// A litmus test that may help a service implementor in deciding
/// between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
/// (a) Use UNAVAILABLE if the client can retry just the failing call.
/// (b) Use ABORTED if the client should retry at a higher-level
/// (e.g., restarting a read-modify-write sequence).
/// (c) Use FAILED_PRECONDITION if the client should not retry until
/// the system state has been explicitly fixed. E.g., if an "rmdir"
/// fails because the directory is non-empty, FAILED_PRECONDITION
/// should be returned since the client should not retry unless
/// they have first fixed up the directory by deleting files from it.
/// (d) Use FAILED_PRECONDITION if the client performs conditional
/// REST Get/Update/Delete on a resource and the resource on the
/// server does not match the condition. E.g., conflicting
/// read-modify-write on the same resource.
/// </summary>
[pbr::OriginalName("FAILED_PRECONDITION")] FailedPrecondition = 9,
/// <summary>
/// The operation was aborted, typically due to a concurrency issue
/// like sequencer check failures, transaction aborts, etc.
///
/// See litmus test above for deciding between FAILED_PRECONDITION,
/// ABORTED, and UNAVAILABLE.
/// </summary>
[pbr::OriginalName("ABORTED")] Aborted = 10,
/// <summary>
/// Operation tried to iterate past the valid input range. E.g., seeking or
/// reading past end of file.
///
/// Unlike INVALID_ARGUMENT, this error indicates a problem that may
/// be fixed if the system state changes. For example, a 32-bit file
/// system will generate INVALID_ARGUMENT if asked to read at an
/// offset that is not in the range [0,2^32-1], but it will generate
/// OUT_OF_RANGE if asked to read from an offset past the current
/// file size.
///
/// There is a fair bit of overlap between FAILED_PRECONDITION and
/// OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific
/// error) when it applies so that callers who are iterating through
/// a space can easily look for an OUT_OF_RANGE error to detect when
/// they are done.
/// </summary>
[pbr::OriginalName("OUT_OF_RANGE")] OutOfRange = 11,
/// <summary>
/// Operation is not implemented or not supported/enabled in this service.
/// </summary>
[pbr::OriginalName("UNIMPLEMENTED")] Unimplemented = 12,
/// <summary>
/// Internal errors. Means some invariants expected by underlying
/// system has been broken. If you see one of these errors,
/// something is very broken.
/// </summary>
[pbr::OriginalName("INTERNAL")] Internal = 13,
/// <summary>
/// The service is currently unavailable. This is a most likely a
/// transient condition and may be corrected by retrying with
/// a backoff.
///
/// See litmus test above for deciding between FAILED_PRECONDITION,
/// ABORTED, and UNAVAILABLE.
/// </summary>
[pbr::OriginalName("UNAVAILABLE")] Unavailable = 14,
/// <summary>
/// Unrecoverable data loss or corruption.
/// </summary>
[pbr::OriginalName("DATA_LOSS")] DataLoss = 15,
/// <summary>
/// An extra enum entry to prevent people from writing code that
/// fails to compile when a new code is added.
///
/// Nobody should ever reference this enumeration entry. In particular,
/// if you write C++ code that switches on this enumeration, add a default:
/// case instead of a case that mentions this enumeration entry.
///
/// Nobody should rely on the value (currently 20) listed here. It
/// may change in the future.
/// </summary>
[pbr::OriginalName("DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_")] DoNotUseReservedForFutureExpansionUseDefaultInSwitchInstead = 20,
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,327 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/example/example.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/example/example.proto</summary>
public static partial class ExampleReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/example/example.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ExampleReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiV0ZW5zb3JmbG93L2NvcmUvZXhhbXBsZS9leGFtcGxlLnByb3RvEgp0ZW5z",
"b3JmbG93GiV0ZW5zb3JmbG93L2NvcmUvZXhhbXBsZS9mZWF0dXJlLnByb3Rv",
"IjEKB0V4YW1wbGUSJgoIZmVhdHVyZXMYASABKAsyFC50ZW5zb3JmbG93LkZl",
"YXR1cmVzImkKD1NlcXVlbmNlRXhhbXBsZRIlCgdjb250ZXh0GAEgASgLMhQu",
"dGVuc29yZmxvdy5GZWF0dXJlcxIvCg1mZWF0dXJlX2xpc3RzGAIgASgLMhgu",
"dGVuc29yZmxvdy5GZWF0dXJlTGlzdHNCLAoWb3JnLnRlbnNvcmZsb3cuZXhh",
"bXBsZUINRXhhbXBsZVByb3Rvc1AB+AEBYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.FeatureReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Example), global::Tensorflow.Example.Parser, new[]{ "Features" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.SequenceExample), global::Tensorflow.SequenceExample.Parser, new[]{ "Context", "FeatureLists" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class Example : pb::IMessage<Example> {
private static readonly pb::MessageParser<Example> _parser = new pb::MessageParser<Example>(() => new Example());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Example> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.ExampleReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Example() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Example(Example other) : this() {
Features = other.features_ != null ? other.Features.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Example Clone() {
return new Example(this);
}
/// <summary>Field number for the "features" field.</summary>
public const int FeaturesFieldNumber = 1;
private global::Tensorflow.Features features_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Features Features {
get { return features_; }
set {
features_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Example);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Example other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Features, other.Features)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (features_ != null) hash ^= Features.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (features_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Features);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (features_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Features);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Example other) {
if (other == null) {
return;
}
if (other.features_ != null) {
if (features_ == null) {
features_ = new global::Tensorflow.Features();
}
Features.MergeFrom(other.Features);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (features_ == null) {
features_ = new global::Tensorflow.Features();
}
input.ReadMessage(features_);
break;
}
}
}
}
}
public sealed partial class SequenceExample : pb::IMessage<SequenceExample> {
private static readonly pb::MessageParser<SequenceExample> _parser = new pb::MessageParser<SequenceExample>(() => new SequenceExample());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SequenceExample> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.ExampleReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SequenceExample() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SequenceExample(SequenceExample other) : this() {
Context = other.context_ != null ? other.Context.Clone() : null;
FeatureLists = other.featureLists_ != null ? other.FeatureLists.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SequenceExample Clone() {
return new SequenceExample(this);
}
/// <summary>Field number for the "context" field.</summary>
public const int ContextFieldNumber = 1;
private global::Tensorflow.Features context_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Features Context {
get { return context_; }
set {
context_ = value;
}
}
/// <summary>Field number for the "feature_lists" field.</summary>
public const int FeatureListsFieldNumber = 2;
private global::Tensorflow.FeatureLists featureLists_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.FeatureLists FeatureLists {
get { return featureLists_; }
set {
featureLists_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SequenceExample);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(SequenceExample other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Context, other.Context)) return false;
if (!object.Equals(FeatureLists, other.FeatureLists)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (context_ != null) hash ^= Context.GetHashCode();
if (featureLists_ != null) hash ^= FeatureLists.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (context_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Context);
}
if (featureLists_ != null) {
output.WriteRawTag(18);
output.WriteMessage(FeatureLists);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (context_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Context);
}
if (featureLists_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(FeatureLists);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(SequenceExample other) {
if (other == null) {
return;
}
if (other.context_ != null) {
if (context_ == null) {
context_ = new global::Tensorflow.Features();
}
Context.MergeFrom(other.Context);
}
if (other.featureLists_ != null) {
if (featureLists_ == null) {
featureLists_ = new global::Tensorflow.FeatureLists();
}
FeatureLists.MergeFrom(other.FeatureLists);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (context_ == null) {
context_ = new global::Tensorflow.Features();
}
input.ReadMessage(context_);
break;
}
case 18: {
if (featureLists_ == null) {
featureLists_ = new global::Tensorflow.FeatureLists();
}
input.ReadMessage(featureLists_);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,960 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/example/feature.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/example/feature.proto</summary>
public static partial class FeatureReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/example/feature.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static FeatureReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiV0ZW5zb3JmbG93L2NvcmUvZXhhbXBsZS9mZWF0dXJlLnByb3RvEgp0ZW5z",
"b3JmbG93IhoKCUJ5dGVzTGlzdBINCgV2YWx1ZRgBIAMoDCIeCglGbG9hdExp",
"c3QSEQoFdmFsdWUYASADKAJCAhABIh4KCUludDY0TGlzdBIRCgV2YWx1ZRgB",
"IAMoA0ICEAEimAEKB0ZlYXR1cmUSKwoKYnl0ZXNfbGlzdBgBIAEoCzIVLnRl",
"bnNvcmZsb3cuQnl0ZXNMaXN0SAASKwoKZmxvYXRfbGlzdBgCIAEoCzIVLnRl",
"bnNvcmZsb3cuRmxvYXRMaXN0SAASKwoKaW50NjRfbGlzdBgDIAEoCzIVLnRl",
"bnNvcmZsb3cuSW50NjRMaXN0SABCBgoEa2luZCKDAQoIRmVhdHVyZXMSMgoH",
"ZmVhdHVyZRgBIAMoCzIhLnRlbnNvcmZsb3cuRmVhdHVyZXMuRmVhdHVyZUVu",
"dHJ5GkMKDEZlYXR1cmVFbnRyeRILCgNrZXkYASABKAkSIgoFdmFsdWUYAiAB",
"KAsyEy50ZW5zb3JmbG93LkZlYXR1cmU6AjgBIjMKC0ZlYXR1cmVMaXN0EiQK",
"B2ZlYXR1cmUYASADKAsyEy50ZW5zb3JmbG93LkZlYXR1cmUinAEKDEZlYXR1",
"cmVMaXN0cxI/CgxmZWF0dXJlX2xpc3QYASADKAsyKS50ZW5zb3JmbG93LkZl",
"YXR1cmVMaXN0cy5GZWF0dXJlTGlzdEVudHJ5GksKEEZlYXR1cmVMaXN0RW50",
"cnkSCwoDa2V5GAEgASgJEiYKBXZhbHVlGAIgASgLMhcudGVuc29yZmxvdy5G",
"ZWF0dXJlTGlzdDoCOAFCLAoWb3JnLnRlbnNvcmZsb3cuZXhhbXBsZUINRmVh",
"dHVyZVByb3Rvc1AB+AEBYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.BytesList), global::Tensorflow.BytesList.Parser, new[]{ "Value" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.FloatList), global::Tensorflow.FloatList.Parser, new[]{ "Value" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Int64List), global::Tensorflow.Int64List.Parser, new[]{ "Value" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Feature), global::Tensorflow.Feature.Parser, new[]{ "BytesList", "FloatList", "Int64List" }, new[]{ "Kind" }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Features), global::Tensorflow.Features.Parser, new[]{ "Feature" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.FeatureList), global::Tensorflow.FeatureList.Parser, new[]{ "Feature" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.FeatureLists), global::Tensorflow.FeatureLists.Parser, new[]{ "FeatureList" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
}));
}
#endregion
}
#region Messages
/// <summary>
/// Containers to hold repeated fundamental values.
/// </summary>
public sealed partial class BytesList : pb::IMessage<BytesList> {
private static readonly pb::MessageParser<BytesList> _parser = new pb::MessageParser<BytesList>(() => new BytesList());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<BytesList> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FeatureReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BytesList() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BytesList(BytesList other) : this() {
value_ = other.value_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BytesList Clone() {
return new BytesList(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private static readonly pb::FieldCodec<pb::ByteString> _repeated_value_codec
= pb::FieldCodec.ForBytes(10);
private readonly pbc::RepeatedField<pb::ByteString> value_ = new pbc::RepeatedField<pb::ByteString>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<pb::ByteString> Value {
get { return value_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as BytesList);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(BytesList other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!value_.Equals(other.value_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= value_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
value_.WriteTo(output, _repeated_value_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += value_.CalculateSize(_repeated_value_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(BytesList other) {
if (other == null) {
return;
}
value_.Add(other.value_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
value_.AddEntriesFrom(input, _repeated_value_codec);
break;
}
}
}
}
}
public sealed partial class FloatList : pb::IMessage<FloatList> {
private static readonly pb::MessageParser<FloatList> _parser = new pb::MessageParser<FloatList>(() => new FloatList());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FloatList> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FeatureReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FloatList() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FloatList(FloatList other) : this() {
value_ = other.value_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FloatList Clone() {
return new FloatList(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private static readonly pb::FieldCodec<float> _repeated_value_codec
= pb::FieldCodec.ForFloat(10);
private readonly pbc::RepeatedField<float> value_ = new pbc::RepeatedField<float>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> Value {
get { return value_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FloatList);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FloatList other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!value_.Equals(other.value_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= value_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
value_.WriteTo(output, _repeated_value_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += value_.CalculateSize(_repeated_value_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FloatList other) {
if (other == null) {
return;
}
value_.Add(other.value_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10:
case 13: {
value_.AddEntriesFrom(input, _repeated_value_codec);
break;
}
}
}
}
}
public sealed partial class Int64List : pb::IMessage<Int64List> {
private static readonly pb::MessageParser<Int64List> _parser = new pb::MessageParser<Int64List>(() => new Int64List());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Int64List> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FeatureReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Int64List() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Int64List(Int64List other) : this() {
value_ = other.value_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Int64List Clone() {
return new Int64List(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private static readonly pb::FieldCodec<long> _repeated_value_codec
= pb::FieldCodec.ForInt64(10);
private readonly pbc::RepeatedField<long> value_ = new pbc::RepeatedField<long>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<long> Value {
get { return value_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Int64List);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Int64List other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!value_.Equals(other.value_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= value_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
value_.WriteTo(output, _repeated_value_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += value_.CalculateSize(_repeated_value_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Int64List other) {
if (other == null) {
return;
}
value_.Add(other.value_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10:
case 8: {
value_.AddEntriesFrom(input, _repeated_value_codec);
break;
}
}
}
}
}
/// <summary>
/// Containers for non-sequential data.
/// </summary>
public sealed partial class Feature : pb::IMessage<Feature> {
private static readonly pb::MessageParser<Feature> _parser = new pb::MessageParser<Feature>(() => new Feature());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Feature> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FeatureReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Feature() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Feature(Feature other) : this() {
switch (other.KindCase) {
case KindOneofCase.BytesList:
BytesList = other.BytesList.Clone();
break;
case KindOneofCase.FloatList:
FloatList = other.FloatList.Clone();
break;
case KindOneofCase.Int64List:
Int64List = other.Int64List.Clone();
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Feature Clone() {
return new Feature(this);
}
/// <summary>Field number for the "bytes_list" field.</summary>
public const int BytesListFieldNumber = 1;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.BytesList BytesList {
get { return kindCase_ == KindOneofCase.BytesList ? (global::Tensorflow.BytesList) kind_ : null; }
set {
kind_ = value;
kindCase_ = value == null ? KindOneofCase.None : KindOneofCase.BytesList;
}
}
/// <summary>Field number for the "float_list" field.</summary>
public const int FloatListFieldNumber = 2;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.FloatList FloatList {
get { return kindCase_ == KindOneofCase.FloatList ? (global::Tensorflow.FloatList) kind_ : null; }
set {
kind_ = value;
kindCase_ = value == null ? KindOneofCase.None : KindOneofCase.FloatList;
}
}
/// <summary>Field number for the "int64_list" field.</summary>
public const int Int64ListFieldNumber = 3;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Int64List Int64List {
get { return kindCase_ == KindOneofCase.Int64List ? (global::Tensorflow.Int64List) kind_ : null; }
set {
kind_ = value;
kindCase_ = value == null ? KindOneofCase.None : KindOneofCase.Int64List;
}
}
private object kind_;
/// <summary>Enum of possible cases for the "kind" oneof.</summary>
public enum KindOneofCase {
None = 0,
BytesList = 1,
FloatList = 2,
Int64List = 3,
}
private KindOneofCase kindCase_ = KindOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public KindOneofCase KindCase {
get { return kindCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearKind() {
kindCase_ = KindOneofCase.None;
kind_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Feature);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Feature other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(BytesList, other.BytesList)) return false;
if (!object.Equals(FloatList, other.FloatList)) return false;
if (!object.Equals(Int64List, other.Int64List)) return false;
if (KindCase != other.KindCase) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (kindCase_ == KindOneofCase.BytesList) hash ^= BytesList.GetHashCode();
if (kindCase_ == KindOneofCase.FloatList) hash ^= FloatList.GetHashCode();
if (kindCase_ == KindOneofCase.Int64List) hash ^= Int64List.GetHashCode();
hash ^= (int) kindCase_;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (kindCase_ == KindOneofCase.BytesList) {
output.WriteRawTag(10);
output.WriteMessage(BytesList);
}
if (kindCase_ == KindOneofCase.FloatList) {
output.WriteRawTag(18);
output.WriteMessage(FloatList);
}
if (kindCase_ == KindOneofCase.Int64List) {
output.WriteRawTag(26);
output.WriteMessage(Int64List);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (kindCase_ == KindOneofCase.BytesList) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(BytesList);
}
if (kindCase_ == KindOneofCase.FloatList) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(FloatList);
}
if (kindCase_ == KindOneofCase.Int64List) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Int64List);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Feature other) {
if (other == null) {
return;
}
switch (other.KindCase) {
case KindOneofCase.BytesList:
BytesList = other.BytesList;
break;
case KindOneofCase.FloatList:
FloatList = other.FloatList;
break;
case KindOneofCase.Int64List:
Int64List = other.Int64List;
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
global::Tensorflow.BytesList subBuilder = new global::Tensorflow.BytesList();
if (kindCase_ == KindOneofCase.BytesList) {
subBuilder.MergeFrom(BytesList);
}
input.ReadMessage(subBuilder);
BytesList = subBuilder;
break;
}
case 18: {
global::Tensorflow.FloatList subBuilder = new global::Tensorflow.FloatList();
if (kindCase_ == KindOneofCase.FloatList) {
subBuilder.MergeFrom(FloatList);
}
input.ReadMessage(subBuilder);
FloatList = subBuilder;
break;
}
case 26: {
global::Tensorflow.Int64List subBuilder = new global::Tensorflow.Int64List();
if (kindCase_ == KindOneofCase.Int64List) {
subBuilder.MergeFrom(Int64List);
}
input.ReadMessage(subBuilder);
Int64List = subBuilder;
break;
}
}
}
}
}
public sealed partial class Features : pb::IMessage<Features> {
private static readonly pb::MessageParser<Features> _parser = new pb::MessageParser<Features>(() => new Features());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Features> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FeatureReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Features() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Features(Features other) : this() {
feature_ = other.feature_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Features Clone() {
return new Features(this);
}
/// <summary>Field number for the "feature" field.</summary>
public const int FeatureFieldNumber = 1;
private static readonly pbc::MapField<string, global::Tensorflow.Feature>.Codec _map_feature_codec
= new pbc::MapField<string, global::Tensorflow.Feature>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Tensorflow.Feature.Parser), 10);
private readonly pbc::MapField<string, global::Tensorflow.Feature> feature_ = new pbc::MapField<string, global::Tensorflow.Feature>();
/// <summary>
/// Map from feature name to feature.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Tensorflow.Feature> Feature {
get { return feature_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Features);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Features other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!Feature.Equals(other.Feature)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= Feature.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
feature_.WriteTo(output, _map_feature_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += feature_.CalculateSize(_map_feature_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Features other) {
if (other == null) {
return;
}
feature_.Add(other.feature_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
feature_.AddEntriesFrom(input, _map_feature_codec);
break;
}
}
}
}
}
/// <summary>
/// Containers for sequential data.
///
/// A FeatureList contains lists of Features. These may hold zero or more
/// Feature values.
///
/// FeatureLists are organized into categories by name. The FeatureLists message
/// contains the mapping from name to FeatureList.
/// </summary>
public sealed partial class FeatureList : pb::IMessage<FeatureList> {
private static readonly pb::MessageParser<FeatureList> _parser = new pb::MessageParser<FeatureList>(() => new FeatureList());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FeatureList> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FeatureReflection.Descriptor.MessageTypes[5]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FeatureList() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FeatureList(FeatureList other) : this() {
feature_ = other.feature_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FeatureList Clone() {
return new FeatureList(this);
}
/// <summary>Field number for the "feature" field.</summary>
public const int FeatureFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Feature> _repeated_feature_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Feature.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Feature> feature_ = new pbc::RepeatedField<global::Tensorflow.Feature>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Feature> Feature {
get { return feature_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FeatureList);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FeatureList other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!feature_.Equals(other.feature_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= feature_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
feature_.WriteTo(output, _repeated_feature_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += feature_.CalculateSize(_repeated_feature_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FeatureList other) {
if (other == null) {
return;
}
feature_.Add(other.feature_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
feature_.AddEntriesFrom(input, _repeated_feature_codec);
break;
}
}
}
}
}
public sealed partial class FeatureLists : pb::IMessage<FeatureLists> {
private static readonly pb::MessageParser<FeatureLists> _parser = new pb::MessageParser<FeatureLists>(() => new FeatureLists());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FeatureLists> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FeatureReflection.Descriptor.MessageTypes[6]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FeatureLists() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FeatureLists(FeatureLists other) : this() {
featureList_ = other.featureList_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FeatureLists Clone() {
return new FeatureLists(this);
}
/// <summary>Field number for the "feature_list" field.</summary>
public const int FeatureListFieldNumber = 1;
private static readonly pbc::MapField<string, global::Tensorflow.FeatureList>.Codec _map_featureList_codec
= new pbc::MapField<string, global::Tensorflow.FeatureList>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Tensorflow.FeatureList.Parser), 10);
private readonly pbc::MapField<string, global::Tensorflow.FeatureList> featureList_ = new pbc::MapField<string, global::Tensorflow.FeatureList>();
/// <summary>
/// Map from feature name to feature list.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Tensorflow.FeatureList> FeatureList {
get { return featureList_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FeatureLists);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FeatureLists other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!FeatureList.Equals(other.FeatureList)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= FeatureList.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
featureList_.WriteTo(output, _map_featureList_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += featureList_.CalculateSize(_map_featureList_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FeatureLists other) {
if (other == null) {
return;
}
featureList_.Add(other.featureList_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
featureList_.AddEntriesFrom(input, _map_featureList_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,567 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/function.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/function.proto</summary>
public static partial class FunctionReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/function.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static FunctionReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2Z1bmN0aW9uLnByb3RvEgp0",
"ZW5zb3JmbG93Gip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2F0dHJfdmFs",
"dWUucHJvdG8aKHRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvbm9kZV9kZWYu",
"cHJvdG8aJnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvb3BfZGVmLnByb3Rv",
"ImoKEkZ1bmN0aW9uRGVmTGlicmFyeRIpCghmdW5jdGlvbhgBIAMoCzIXLnRl",
"bnNvcmZsb3cuRnVuY3Rpb25EZWYSKQoIZ3JhZGllbnQYAiADKAsyFy50ZW5z",
"b3JmbG93LkdyYWRpZW50RGVmIqoCCgtGdW5jdGlvbkRlZhIkCglzaWduYXR1",
"cmUYASABKAsyES50ZW5zb3JmbG93Lk9wRGVmEi8KBGF0dHIYBSADKAsyIS50",
"ZW5zb3JmbG93LkZ1bmN0aW9uRGVmLkF0dHJFbnRyeRIlCghub2RlX2RlZhgD",
"IAMoCzITLnRlbnNvcmZsb3cuTm9kZURlZhItCgNyZXQYBCADKAsyIC50ZW5z",
"b3JmbG93LkZ1bmN0aW9uRGVmLlJldEVudHJ5GkIKCUF0dHJFbnRyeRILCgNr",
"ZXkYASABKAkSJAoFdmFsdWUYAiABKAsyFS50ZW5zb3JmbG93LkF0dHJWYWx1",
"ZToCOAEaKgoIUmV0RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJ",
"OgI4ASI7CgtHcmFkaWVudERlZhIVCg1mdW5jdGlvbl9uYW1lGAEgASgJEhUK",
"DWdyYWRpZW50X2Z1bmMYAiABKAlCLwoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3",
"b3JrQg5GdW5jdGlvblByb3Rvc1AB+AEBYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.AttrValueReflection.Descriptor, global::Tensorflow.NodeDefReflection.Descriptor, global::Tensorflow.OpDefReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.FunctionDefLibrary), global::Tensorflow.FunctionDefLibrary.Parser, new[]{ "Function", "Gradient" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.FunctionDef), global::Tensorflow.FunctionDef.Parser, new[]{ "Signature", "Attr", "NodeDef", "Ret" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GradientDef), global::Tensorflow.GradientDef.Parser, new[]{ "FunctionName", "GradientFunc" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// A library is a set of named functions.
/// </summary>
public sealed partial class FunctionDefLibrary : pb::IMessage<FunctionDefLibrary> {
private static readonly pb::MessageParser<FunctionDefLibrary> _parser = new pb::MessageParser<FunctionDefLibrary>(() => new FunctionDefLibrary());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FunctionDefLibrary> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FunctionReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FunctionDefLibrary() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FunctionDefLibrary(FunctionDefLibrary other) : this() {
function_ = other.function_.Clone();
gradient_ = other.gradient_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FunctionDefLibrary Clone() {
return new FunctionDefLibrary(this);
}
/// <summary>Field number for the "function" field.</summary>
public const int FunctionFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.FunctionDef> _repeated_function_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.FunctionDef.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.FunctionDef> function_ = new pbc::RepeatedField<global::Tensorflow.FunctionDef>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.FunctionDef> Function {
get { return function_; }
}
/// <summary>Field number for the "gradient" field.</summary>
public const int GradientFieldNumber = 2;
private static readonly pb::FieldCodec<global::Tensorflow.GradientDef> _repeated_gradient_codec
= pb::FieldCodec.ForMessage(18, global::Tensorflow.GradientDef.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.GradientDef> gradient_ = new pbc::RepeatedField<global::Tensorflow.GradientDef>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.GradientDef> Gradient {
get { return gradient_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FunctionDefLibrary);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FunctionDefLibrary other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!function_.Equals(other.function_)) return false;
if(!gradient_.Equals(other.gradient_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= function_.GetHashCode();
hash ^= gradient_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
function_.WriteTo(output, _repeated_function_codec);
gradient_.WriteTo(output, _repeated_gradient_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += function_.CalculateSize(_repeated_function_codec);
size += gradient_.CalculateSize(_repeated_gradient_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FunctionDefLibrary other) {
if (other == null) {
return;
}
function_.Add(other.function_);
gradient_.Add(other.gradient_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
function_.AddEntriesFrom(input, _repeated_function_codec);
break;
}
case 18: {
gradient_.AddEntriesFrom(input, _repeated_gradient_codec);
break;
}
}
}
}
}
/// <summary>
/// A function can be instantiated when the runtime can bind every attr
/// with a value. When a GraphDef has a call to a function, it must
/// have binding for every attr defined in the signature.
///
/// TODO(zhifengc):
/// * device spec, etc.
/// </summary>
public sealed partial class FunctionDef : pb::IMessage<FunctionDef> {
private static readonly pb::MessageParser<FunctionDef> _parser = new pb::MessageParser<FunctionDef>(() => new FunctionDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FunctionDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FunctionReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FunctionDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FunctionDef(FunctionDef other) : this() {
Signature = other.signature_ != null ? other.Signature.Clone() : null;
attr_ = other.attr_.Clone();
nodeDef_ = other.nodeDef_.Clone();
ret_ = other.ret_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FunctionDef Clone() {
return new FunctionDef(this);
}
/// <summary>Field number for the "signature" field.</summary>
public const int SignatureFieldNumber = 1;
private global::Tensorflow.OpDef signature_;
/// <summary>
/// The definition of the function's name, arguments, return values,
/// attrs etc.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.OpDef Signature {
get { return signature_; }
set {
signature_ = value;
}
}
/// <summary>Field number for the "attr" field.</summary>
public const int AttrFieldNumber = 5;
private static readonly pbc::MapField<string, global::Tensorflow.AttrValue>.Codec _map_attr_codec
= new pbc::MapField<string, global::Tensorflow.AttrValue>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Tensorflow.AttrValue.Parser), 42);
private readonly pbc::MapField<string, global::Tensorflow.AttrValue> attr_ = new pbc::MapField<string, global::Tensorflow.AttrValue>();
/// <summary>
/// Attributes specific to this function definition.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Tensorflow.AttrValue> Attr {
get { return attr_; }
}
/// <summary>Field number for the "node_def" field.</summary>
public const int NodeDefFieldNumber = 3;
private static readonly pb::FieldCodec<global::Tensorflow.NodeDef> _repeated_nodeDef_codec
= pb::FieldCodec.ForMessage(26, global::Tensorflow.NodeDef.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.NodeDef> nodeDef_ = new pbc::RepeatedField<global::Tensorflow.NodeDef>();
/// <summary>
/// By convention, "op" in node_def is resolved by consulting with a
/// user-defined library first. If not resolved, "func" is assumed to
/// be a builtin op.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.NodeDef> NodeDef {
get { return nodeDef_; }
}
/// <summary>Field number for the "ret" field.</summary>
public const int RetFieldNumber = 4;
private static readonly pbc::MapField<string, string>.Codec _map_ret_codec
= new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 34);
private readonly pbc::MapField<string, string> ret_ = new pbc::MapField<string, string>();
/// <summary>
/// A mapping from the output arg names from `signature` to the
/// outputs from `node_def` that should be returned by the function.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, string> Ret {
get { return ret_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FunctionDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FunctionDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Signature, other.Signature)) return false;
if (!Attr.Equals(other.Attr)) return false;
if(!nodeDef_.Equals(other.nodeDef_)) return false;
if (!Ret.Equals(other.Ret)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (signature_ != null) hash ^= Signature.GetHashCode();
hash ^= Attr.GetHashCode();
hash ^= nodeDef_.GetHashCode();
hash ^= Ret.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (signature_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Signature);
}
nodeDef_.WriteTo(output, _repeated_nodeDef_codec);
ret_.WriteTo(output, _map_ret_codec);
attr_.WriteTo(output, _map_attr_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (signature_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Signature);
}
size += attr_.CalculateSize(_map_attr_codec);
size += nodeDef_.CalculateSize(_repeated_nodeDef_codec);
size += ret_.CalculateSize(_map_ret_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FunctionDef other) {
if (other == null) {
return;
}
if (other.signature_ != null) {
if (signature_ == null) {
signature_ = new global::Tensorflow.OpDef();
}
Signature.MergeFrom(other.Signature);
}
attr_.Add(other.attr_);
nodeDef_.Add(other.nodeDef_);
ret_.Add(other.ret_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (signature_ == null) {
signature_ = new global::Tensorflow.OpDef();
}
input.ReadMessage(signature_);
break;
}
case 26: {
nodeDef_.AddEntriesFrom(input, _repeated_nodeDef_codec);
break;
}
case 34: {
ret_.AddEntriesFrom(input, _map_ret_codec);
break;
}
case 42: {
attr_.AddEntriesFrom(input, _map_attr_codec);
break;
}
}
}
}
}
/// <summary>
/// GradientDef defines the gradient function of a function defined in
/// a function library.
///
/// A gradient function g (specified by gradient_func) for a function f
/// (specified by function_name) must follow the following:
///
/// The function 'f' must be a numerical function which takes N inputs
/// and produces M outputs. Its gradient function 'g', which is a
/// function taking N + M inputs and produces N outputs.
///
/// I.e. if we have
/// (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
/// then, g is
/// (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
/// dL/dy1, dL/dy2, ..., dL/dy_M),
/// where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
/// loss function). dL/dx_i is the partial derivative of L with respect
/// to x_i.
/// </summary>
public sealed partial class GradientDef : pb::IMessage<GradientDef> {
private static readonly pb::MessageParser<GradientDef> _parser = new pb::MessageParser<GradientDef>(() => new GradientDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GradientDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.FunctionReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GradientDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GradientDef(GradientDef other) : this() {
functionName_ = other.functionName_;
gradientFunc_ = other.gradientFunc_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GradientDef Clone() {
return new GradientDef(this);
}
/// <summary>Field number for the "function_name" field.</summary>
public const int FunctionNameFieldNumber = 1;
private string functionName_ = "";
/// <summary>
/// The function name.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string FunctionName {
get { return functionName_; }
set {
functionName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "gradient_func" field.</summary>
public const int GradientFuncFieldNumber = 2;
private string gradientFunc_ = "";
/// <summary>
/// The gradient function's name.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string GradientFunc {
get { return gradientFunc_; }
set {
gradientFunc_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GradientDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GradientDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (FunctionName != other.FunctionName) return false;
if (GradientFunc != other.GradientFunc) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (FunctionName.Length != 0) hash ^= FunctionName.GetHashCode();
if (GradientFunc.Length != 0) hash ^= GradientFunc.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (FunctionName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(FunctionName);
}
if (GradientFunc.Length != 0) {
output.WriteRawTag(18);
output.WriteString(GradientFunc);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (FunctionName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(FunctionName);
}
if (GradientFunc.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(GradientFunc);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GradientDef other) {
if (other == null) {
return;
}
if (other.FunctionName.Length != 0) {
FunctionName = other.FunctionName;
}
if (other.GradientFunc.Length != 0) {
GradientFunc = other.GradientFunc;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
FunctionName = input.ReadString();
break;
}
case 18: {
GradientFunc = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,296 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/graph.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/graph.proto</summary>
public static partial class GraphReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/graph.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static GraphReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2dyYXBoLnByb3RvEgp0ZW5z",
"b3JmbG93Gih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL25vZGVfZGVmLnBy",
"b3RvGih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2Z1bmN0aW9uLnByb3Rv",
"Gih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3ZlcnNpb25zLnByb3RvIp0B",
"CghHcmFwaERlZhIhCgRub2RlGAEgAygLMhMudGVuc29yZmxvdy5Ob2RlRGVm",
"EigKCHZlcnNpb25zGAQgASgLMhYudGVuc29yZmxvdy5WZXJzaW9uRGVmEhMK",
"B3ZlcnNpb24YAyABKAVCAhgBEi8KB2xpYnJhcnkYAiABKAsyHi50ZW5zb3Jm",
"bG93LkZ1bmN0aW9uRGVmTGlicmFyeUIsChhvcmcudGVuc29yZmxvdy5mcmFt",
"ZXdvcmtCC0dyYXBoUHJvdG9zUAH4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.NodeDefReflection.Descriptor, global::Tensorflow.FunctionReflection.Descriptor, global::Tensorflow.VersionsReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphDef), global::Tensorflow.GraphDef.Parser, new[]{ "Node", "Versions", "Version", "Library" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Represents the graph of operations
/// </summary>
public sealed partial class GraphDef : pb::IMessage<GraphDef> {
private static readonly pb::MessageParser<GraphDef> _parser = new pb::MessageParser<GraphDef>(() => new GraphDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GraphDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.GraphReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GraphDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GraphDef(GraphDef other) : this() {
node_ = other.node_.Clone();
Versions = other.versions_ != null ? other.Versions.Clone() : null;
version_ = other.version_;
Library = other.library_ != null ? other.Library.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GraphDef Clone() {
return new GraphDef(this);
}
/// <summary>Field number for the "node" field.</summary>
public const int NodeFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.NodeDef> _repeated_node_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.NodeDef.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.NodeDef> node_ = new pbc::RepeatedField<global::Tensorflow.NodeDef>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.NodeDef> Node {
get { return node_; }
}
/// <summary>Field number for the "versions" field.</summary>
public const int VersionsFieldNumber = 4;
private global::Tensorflow.VersionDef versions_;
/// <summary>
/// Compatibility versions of the graph. See core/public/version.h for version
/// history. The GraphDef version is distinct from the TensorFlow version, and
/// each release of TensorFlow will support a range of GraphDef versions.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.VersionDef Versions {
get { return versions_; }
set {
versions_ = value;
}
}
/// <summary>Field number for the "version" field.</summary>
public const int VersionFieldNumber = 3;
private int version_;
/// <summary>
/// Deprecated single version field; use versions above instead. Since all
/// GraphDef changes before "versions" was introduced were forward
/// compatible, this field is entirely ignored.
/// </summary>
[global::System.ObsoleteAttribute]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Version {
get { return version_; }
set {
version_ = value;
}
}
/// <summary>Field number for the "library" field.</summary>
public const int LibraryFieldNumber = 2;
private global::Tensorflow.FunctionDefLibrary library_;
/// <summary>
/// EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
///
/// "library" provides user-defined functions.
///
/// Naming:
/// * library.function.name are in a flat namespace.
/// NOTE: We may need to change it to be hierarchical to support
/// different orgs. E.g.,
/// { "/google/nn", { ... }},
/// { "/google/vision", { ... }}
/// { "/org_foo/module_bar", { ... }}
/// map&lt;string, FunctionDefLib> named_lib;
/// * If node[i].op is the name of one function in "library",
/// node[i] is deemed as a function call. Otherwise, node[i].op
/// must be a primitive operation supported by the runtime.
///
/// Function call semantics:
///
/// * The callee may start execution as soon as some of its inputs
/// are ready. The caller may want to use Tuple() mechanism to
/// ensure all inputs are ready in the same time.
///
/// * The consumer of return values may start executing as soon as
/// the return values the consumer depends on are ready. The
/// consumer may want to use Tuple() mechanism to ensure the
/// consumer does not start until all return values of the callee
/// function are ready.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.FunctionDefLibrary Library {
get { return library_; }
set {
library_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GraphDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GraphDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!node_.Equals(other.node_)) return false;
if (!object.Equals(Versions, other.Versions)) return false;
if (Version != other.Version) return false;
if (!object.Equals(Library, other.Library)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= node_.GetHashCode();
if (versions_ != null) hash ^= Versions.GetHashCode();
if (Version != 0) hash ^= Version.GetHashCode();
if (library_ != null) hash ^= Library.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
node_.WriteTo(output, _repeated_node_codec);
if (library_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Library);
}
if (Version != 0) {
output.WriteRawTag(24);
output.WriteInt32(Version);
}
if (versions_ != null) {
output.WriteRawTag(34);
output.WriteMessage(Versions);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += node_.CalculateSize(_repeated_node_codec);
if (versions_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Versions);
}
if (Version != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Version);
}
if (library_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Library);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GraphDef other) {
if (other == null) {
return;
}
node_.Add(other.node_);
if (other.versions_ != null) {
if (versions_ == null) {
versions_ = new global::Tensorflow.VersionDef();
}
Versions.MergeFrom(other.Versions);
}
if (other.Version != 0) {
Version = other.Version;
}
if (other.library_ != null) {
if (library_ == null) {
library_ = new global::Tensorflow.FunctionDefLibrary();
}
Library.MergeFrom(other.Library);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
node_.AddEntriesFrom(input, _repeated_node_codec);
break;
}
case 18: {
if (library_ == null) {
library_ = new global::Tensorflow.FunctionDefLibrary();
}
input.ReadMessage(library_);
break;
}
case 24: {
Version = input.ReadInt32();
break;
}
case 34: {
if (versions_ == null) {
versions_ = new global::Tensorflow.VersionDef();
}
input.ReadMessage(versions_);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,203 @@
Copyright 2018 The TensorFlow Authors. All rights reserved.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017, The TensorFlow Authors.
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.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,51 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/master_service.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Grpc {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/master_service.proto</summary>
public static partial class MasterServiceReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/master_service.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static MasterServiceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ci10ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvbWFzdGVyX3NlcnZpY2UucHJv",
"dG8SD3RlbnNvcmZsb3cuZ3JwYxoldGVuc29yZmxvdy9jb3JlL3Byb3RvYnVm",
"L21hc3Rlci5wcm90bzK8BAoNTWFzdGVyU2VydmljZRJUCg1DcmVhdGVTZXNz",
"aW9uEiAudGVuc29yZmxvdy5DcmVhdGVTZXNzaW9uUmVxdWVzdBohLnRlbnNv",
"cmZsb3cuQ3JlYXRlU2Vzc2lvblJlc3BvbnNlElQKDUV4dGVuZFNlc3Npb24S",
"IC50ZW5zb3JmbG93LkV4dGVuZFNlc3Npb25SZXF1ZXN0GiEudGVuc29yZmxv",
"dy5FeHRlbmRTZXNzaW9uUmVzcG9uc2USWgoPUGFydGlhbFJ1blNldHVwEiIu",
"dGVuc29yZmxvdy5QYXJ0aWFsUnVuU2V0dXBSZXF1ZXN0GiMudGVuc29yZmxv",
"dy5QYXJ0aWFsUnVuU2V0dXBSZXNwb25zZRJCCgdSdW5TdGVwEhoudGVuc29y",
"Zmxvdy5SdW5TdGVwUmVxdWVzdBobLnRlbnNvcmZsb3cuUnVuU3RlcFJlc3Bv",
"bnNlElEKDENsb3NlU2Vzc2lvbhIfLnRlbnNvcmZsb3cuQ2xvc2VTZXNzaW9u",
"UmVxdWVzdBogLnRlbnNvcmZsb3cuQ2xvc2VTZXNzaW9uUmVzcG9uc2USTgoL",
"TGlzdERldmljZXMSHi50ZW5zb3JmbG93Lkxpc3REZXZpY2VzUmVxdWVzdBof",
"LnRlbnNvcmZsb3cuTGlzdERldmljZXNSZXNwb25zZRI8CgVSZXNldBIYLnRl",
"bnNvcmZsb3cuUmVzZXRSZXF1ZXN0GhkudGVuc29yZmxvdy5SZXNldFJlc3Bv",
"bnNlQjMKGm9yZy50ZW5zb3JmbG93LmRpc3RydW50aW1lQhNNYXN0ZXJTZXJ2",
"aWNlUHJvdG9zUAFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.MasterReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null));
}
#endregion
}
}
#endregion Designer generated code

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,210 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/named_tensor.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/named_tensor.proto</summary>
public static partial class NamedTensorReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/named_tensor.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static NamedTensorReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cit0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvbmFtZWRfdGVuc29yLnByb3Rv",
"Egp0ZW5zb3JmbG93GiZ0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNv",
"ci5wcm90byJJChBOYW1lZFRlbnNvclByb3RvEgwKBG5hbWUYASABKAkSJwoG",
"dGVuc29yGAIgASgLMhcudGVuc29yZmxvdy5UZW5zb3JQcm90b0IyChhvcmcu",
"dGVuc29yZmxvdy5mcmFtZXdvcmtCEU5hbWVkVGVuc29yUHJvdG9zUAH4AQFi",
"BnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.TensorReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.NamedTensorProto), global::Tensorflow.NamedTensorProto.Parser, new[]{ "Name", "Tensor" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// A pair of tensor name and tensor values.
/// </summary>
public sealed partial class NamedTensorProto : pb::IMessage<NamedTensorProto> {
private static readonly pb::MessageParser<NamedTensorProto> _parser = new pb::MessageParser<NamedTensorProto>(() => new NamedTensorProto());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NamedTensorProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.NamedTensorReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NamedTensorProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NamedTensorProto(NamedTensorProto other) : this() {
name_ = other.name_;
Tensor = other.tensor_ != null ? other.Tensor.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NamedTensorProto Clone() {
return new NamedTensorProto(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Name of the tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "tensor" field.</summary>
public const int TensorFieldNumber = 2;
private global::Tensorflow.TensorProto tensor_;
/// <summary>
/// The client can populate a TensorProto using a tensorflow::Tensor`, or
/// directly using the protobuf field accessors.
///
/// The client specifies whether the returned tensor values should be
/// filled tensor fields (float_val, int_val, etc.) or encoded in a
/// compact form in tensor.tensor_content.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.TensorProto Tensor {
get { return tensor_; }
set {
tensor_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as NamedTensorProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(NamedTensorProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (!object.Equals(Tensor, other.Tensor)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (tensor_ != null) hash ^= Tensor.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (tensor_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Tensor);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (tensor_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Tensor);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(NamedTensorProto other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.tensor_ != null) {
if (tensor_ == null) {
tensor_ = new global::Tensorflow.TensorProto();
}
Tensor.MergeFrom(other.Tensor);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
if (tensor_ == null) {
tensor_ = new global::Tensorflow.TensorProto();
}
input.ReadMessage(tensor_);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,312 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/node_def.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/node_def.proto</summary>
public static partial class NodeDefReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/node_def.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static NodeDefReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL25vZGVfZGVmLnByb3RvEgp0",
"ZW5zb3JmbG93Gip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2F0dHJfdmFs",
"dWUucHJvdG8iswEKB05vZGVEZWYSDAoEbmFtZRgBIAEoCRIKCgJvcBgCIAEo",
"CRINCgVpbnB1dBgDIAMoCRIOCgZkZXZpY2UYBCABKAkSKwoEYXR0chgFIAMo",
"CzIdLnRlbnNvcmZsb3cuTm9kZURlZi5BdHRyRW50cnkaQgoJQXR0ckVudHJ5",
"EgsKA2tleRgBIAEoCRIkCgV2YWx1ZRgCIAEoCzIVLnRlbnNvcmZsb3cuQXR0",
"clZhbHVlOgI4AUIqChhvcmcudGVuc29yZmxvdy5mcmFtZXdvcmtCCU5vZGVQ",
"cm90b1AB+AEBYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.AttrValueReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.NodeDef), global::Tensorflow.NodeDef.Parser, new[]{ "Name", "Op", "Input", "Device", "Attr" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
}));
}
#endregion
}
#region Messages
public sealed partial class NodeDef : pb::IMessage<NodeDef> {
private static readonly pb::MessageParser<NodeDef> _parser = new pb::MessageParser<NodeDef>(() => new NodeDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NodeDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.NodeDefReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NodeDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NodeDef(NodeDef other) : this() {
name_ = other.name_;
op_ = other.op_;
input_ = other.input_.Clone();
device_ = other.device_;
attr_ = other.attr_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NodeDef Clone() {
return new NodeDef(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// The name given to this operator. Used for naming inputs,
/// logging, visualization, etc. Unique within a single GraphDef.
/// Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "op" field.</summary>
public const int OpFieldNumber = 2;
private string op_ = "";
/// <summary>
/// The operation name. There may be custom parameters in attrs.
/// Op names starting with an underscore are reserved for internal use.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Op {
get { return op_; }
set {
op_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "input" field.</summary>
public const int InputFieldNumber = 3;
private static readonly pb::FieldCodec<string> _repeated_input_codec
= pb::FieldCodec.ForString(26);
private readonly pbc::RepeatedField<string> input_ = new pbc::RepeatedField<string>();
/// <summary>
/// Each input is "node:src_output" with "node" being a string name and
/// "src_output" indicating which output tensor to use from "node". If
/// "src_output" is 0 the ":0" suffix can be omitted. Regular inputs
/// may optionally be followed by control inputs that have the format
/// "^node".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Input {
get { return input_; }
}
/// <summary>Field number for the "device" field.</summary>
public const int DeviceFieldNumber = 4;
private string device_ = "";
/// <summary>
/// A (possibly partial) specification for the device on which this
/// node should be placed.
/// The expected syntax for this string is as follows:
///
/// DEVICE_SPEC ::= PARTIAL_SPEC
///
/// PARTIAL_SPEC ::= ("/" CONSTRAINT) *
/// CONSTRAINT ::= ("job:" JOB_NAME)
/// | ("replica:" [1-9][0-9]*)
/// | ("task:" [1-9][0-9]*)
/// | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
///
/// Valid values for this string include:
/// * "/job:worker/replica:0/task:1/device:GPU:3" (full specification)
/// * "/job:worker/device:GPU:3" (partial specification)
/// * "" (no specification)
///
/// If the constraints do not resolve to a single device (or if this
/// field is empty or not present), the runtime will attempt to
/// choose a device automatically.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Device {
get { return device_; }
set {
device_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "attr" field.</summary>
public const int AttrFieldNumber = 5;
private static readonly pbc::MapField<string, global::Tensorflow.AttrValue>.Codec _map_attr_codec
= new pbc::MapField<string, global::Tensorflow.AttrValue>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Tensorflow.AttrValue.Parser), 42);
private readonly pbc::MapField<string, global::Tensorflow.AttrValue> attr_ = new pbc::MapField<string, global::Tensorflow.AttrValue>();
/// <summary>
/// Operation-specific graph-construction-time configuration.
/// Note that this should include all attrs defined in the
/// corresponding OpDef, including those with a value matching
/// the default -- this allows the default to change and makes
/// NodeDefs easier to interpret on their own. However, if
/// an attr with a default is not specified in this list, the
/// default will be used.
/// The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
/// one of the names from the corresponding OpDef's attr field).
/// The values must have a type matching the corresponding OpDef
/// attr's type field.
/// TODO(josh11b): Add some examples here showing best practices.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Tensorflow.AttrValue> Attr {
get { return attr_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as NodeDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(NodeDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (Op != other.Op) return false;
if(!input_.Equals(other.input_)) return false;
if (Device != other.Device) return false;
if (!Attr.Equals(other.Attr)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Op.Length != 0) hash ^= Op.GetHashCode();
hash ^= input_.GetHashCode();
if (Device.Length != 0) hash ^= Device.GetHashCode();
hash ^= Attr.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Op.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Op);
}
input_.WriteTo(output, _repeated_input_codec);
if (Device.Length != 0) {
output.WriteRawTag(34);
output.WriteString(Device);
}
attr_.WriteTo(output, _map_attr_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (Op.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Op);
}
size += input_.CalculateSize(_repeated_input_codec);
if (Device.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Device);
}
size += attr_.CalculateSize(_map_attr_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(NodeDef other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.Op.Length != 0) {
Op = other.Op;
}
input_.Add(other.input_);
if (other.Device.Length != 0) {
Device = other.Device;
}
attr_.Add(other.attr_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
Op = input.ReadString();
break;
}
case 26: {
input_.AddEntriesFrom(input, _repeated_input_codec);
break;
}
case 34: {
Device = input.ReadString();
break;
}
case 42: {
attr_.AddEntriesFrom(input, _map_attr_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,280 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/queue_runner.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/queue_runner.proto</summary>
public static partial class QueueRunnerReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/queue_runner.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static QueueRunnerReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cit0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvcXVldWVfcnVubmVyLnByb3Rv",
"Egp0ZW5zb3JmbG93Gip0ZW5zb3JmbG93L2NvcmUvbGliL2NvcmUvZXJyb3Jf",
"Y29kZXMucHJvdG8iqgEKDlF1ZXVlUnVubmVyRGVmEhIKCnF1ZXVlX25hbWUY",
"ASABKAkSFwoPZW5xdWV1ZV9vcF9uYW1lGAIgAygJEhUKDWNsb3NlX29wX25h",
"bWUYAyABKAkSFgoOY2FuY2VsX29wX25hbWUYBCABKAkSPAoccXVldWVfY2xv",
"c2VkX2V4Y2VwdGlvbl90eXBlcxgFIAMoDjIWLnRlbnNvcmZsb3cuZXJyb3Iu",
"Q29kZUIyChhvcmcudGVuc29yZmxvdy5mcmFtZXdvcmtCEVF1ZXVlUnVubmVy",
"UHJvdG9zUAH4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.Error.ErrorCodesReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.QueueRunnerDef), global::Tensorflow.QueueRunnerDef.Parser, new[]{ "QueueName", "EnqueueOpName", "CloseOpName", "CancelOpName", "QueueClosedExceptionTypes" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Protocol buffer representing a QueueRunner.
/// </summary>
public sealed partial class QueueRunnerDef : pb::IMessage<QueueRunnerDef> {
private static readonly pb::MessageParser<QueueRunnerDef> _parser = new pb::MessageParser<QueueRunnerDef>(() => new QueueRunnerDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<QueueRunnerDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.QueueRunnerReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public QueueRunnerDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public QueueRunnerDef(QueueRunnerDef other) : this() {
queueName_ = other.queueName_;
enqueueOpName_ = other.enqueueOpName_.Clone();
closeOpName_ = other.closeOpName_;
cancelOpName_ = other.cancelOpName_;
queueClosedExceptionTypes_ = other.queueClosedExceptionTypes_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public QueueRunnerDef Clone() {
return new QueueRunnerDef(this);
}
/// <summary>Field number for the "queue_name" field.</summary>
public const int QueueNameFieldNumber = 1;
private string queueName_ = "";
/// <summary>
/// Queue name.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string QueueName {
get { return queueName_; }
set {
queueName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "enqueue_op_name" field.</summary>
public const int EnqueueOpNameFieldNumber = 2;
private static readonly pb::FieldCodec<string> _repeated_enqueueOpName_codec
= pb::FieldCodec.ForString(18);
private readonly pbc::RepeatedField<string> enqueueOpName_ = new pbc::RepeatedField<string>();
/// <summary>
/// A list of enqueue operations.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> EnqueueOpName {
get { return enqueueOpName_; }
}
/// <summary>Field number for the "close_op_name" field.</summary>
public const int CloseOpNameFieldNumber = 3;
private string closeOpName_ = "";
/// <summary>
/// The operation to run to close the queue.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string CloseOpName {
get { return closeOpName_; }
set {
closeOpName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "cancel_op_name" field.</summary>
public const int CancelOpNameFieldNumber = 4;
private string cancelOpName_ = "";
/// <summary>
/// The operation to run to cancel the queue.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string CancelOpName {
get { return cancelOpName_; }
set {
cancelOpName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "queue_closed_exception_types" field.</summary>
public const int QueueClosedExceptionTypesFieldNumber = 5;
private static readonly pb::FieldCodec<global::Tensorflow.Error.Code> _repeated_queueClosedExceptionTypes_codec
= pb::FieldCodec.ForEnum(42, x => (int) x, x => (global::Tensorflow.Error.Code) x);
private readonly pbc::RepeatedField<global::Tensorflow.Error.Code> queueClosedExceptionTypes_ = new pbc::RepeatedField<global::Tensorflow.Error.Code>();
/// <summary>
/// A list of exception types considered to signal a safely closed queue
/// if raised during enqueue operations.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Error.Code> QueueClosedExceptionTypes {
get { return queueClosedExceptionTypes_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as QueueRunnerDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(QueueRunnerDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (QueueName != other.QueueName) return false;
if(!enqueueOpName_.Equals(other.enqueueOpName_)) return false;
if (CloseOpName != other.CloseOpName) return false;
if (CancelOpName != other.CancelOpName) return false;
if(!queueClosedExceptionTypes_.Equals(other.queueClosedExceptionTypes_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (QueueName.Length != 0) hash ^= QueueName.GetHashCode();
hash ^= enqueueOpName_.GetHashCode();
if (CloseOpName.Length != 0) hash ^= CloseOpName.GetHashCode();
if (CancelOpName.Length != 0) hash ^= CancelOpName.GetHashCode();
hash ^= queueClosedExceptionTypes_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (QueueName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(QueueName);
}
enqueueOpName_.WriteTo(output, _repeated_enqueueOpName_codec);
if (CloseOpName.Length != 0) {
output.WriteRawTag(26);
output.WriteString(CloseOpName);
}
if (CancelOpName.Length != 0) {
output.WriteRawTag(34);
output.WriteString(CancelOpName);
}
queueClosedExceptionTypes_.WriteTo(output, _repeated_queueClosedExceptionTypes_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (QueueName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(QueueName);
}
size += enqueueOpName_.CalculateSize(_repeated_enqueueOpName_codec);
if (CloseOpName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(CloseOpName);
}
if (CancelOpName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(CancelOpName);
}
size += queueClosedExceptionTypes_.CalculateSize(_repeated_queueClosedExceptionTypes_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(QueueRunnerDef other) {
if (other == null) {
return;
}
if (other.QueueName.Length != 0) {
QueueName = other.QueueName;
}
enqueueOpName_.Add(other.enqueueOpName_);
if (other.CloseOpName.Length != 0) {
CloseOpName = other.CloseOpName;
}
if (other.CancelOpName.Length != 0) {
CancelOpName = other.CancelOpName;
}
queueClosedExceptionTypes_.Add(other.queueClosedExceptionTypes_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
QueueName = input.ReadString();
break;
}
case 18: {
enqueueOpName_.AddEntriesFrom(input, _repeated_enqueueOpName_codec);
break;
}
case 26: {
CloseOpName = input.ReadString();
break;
}
case 34: {
CancelOpName = input.ReadString();
break;
}
case 42:
case 40: {
queueClosedExceptionTypes_.AddEntriesFrom(input, _repeated_queueClosedExceptionTypes_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,296 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/resource_handle.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/resource_handle.proto</summary>
public static partial class ResourceHandleReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/resource_handle.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ResourceHandleReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ci90ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3Jlc291cmNlX2hhbmRsZS5w",
"cm90bxIKdGVuc29yZmxvdyJyChNSZXNvdXJjZUhhbmRsZVByb3RvEg4KBmRl",
"dmljZRgBIAEoCRIRCgljb250YWluZXIYAiABKAkSDAoEbmFtZRgDIAEoCRIR",
"CgloYXNoX2NvZGUYBCABKAQSFwoPbWF5YmVfdHlwZV9uYW1lGAUgASgJQi8K",
"GG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IOUmVzb3VyY2VIYW5kbGVQAfgB",
"AWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ResourceHandleProto), global::Tensorflow.ResourceHandleProto.Parser, new[]{ "Device", "Container", "Name", "HashCode", "MaybeTypeName" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Protocol buffer representing a handle to a tensorflow resource. Handles are
/// not valid across executions, but can be serialized back and forth from within
/// a single run.
/// </summary>
public sealed partial class ResourceHandleProto : pb::IMessage<ResourceHandleProto> {
private static readonly pb::MessageParser<ResourceHandleProto> _parser = new pb::MessageParser<ResourceHandleProto>(() => new ResourceHandleProto());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ResourceHandleProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.ResourceHandleReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ResourceHandleProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ResourceHandleProto(ResourceHandleProto other) : this() {
device_ = other.device_;
container_ = other.container_;
name_ = other.name_;
hashCode_ = other.hashCode_;
maybeTypeName_ = other.maybeTypeName_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ResourceHandleProto Clone() {
return new ResourceHandleProto(this);
}
/// <summary>Field number for the "device" field.</summary>
public const int DeviceFieldNumber = 1;
private string device_ = "";
/// <summary>
/// Unique name for the device containing the resource.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Device {
get { return device_; }
set {
device_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "container" field.</summary>
public const int ContainerFieldNumber = 2;
private string container_ = "";
/// <summary>
/// Container in which this resource is placed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Container {
get { return container_; }
set {
container_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 3;
private string name_ = "";
/// <summary>
/// Unique name of this resource.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "hash_code" field.</summary>
public const int HashCodeFieldNumber = 4;
private ulong hashCode_;
/// <summary>
/// Hash code for the type of the resource. Is only valid in the same device
/// and in the same execution.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ulong HashCode {
get { return hashCode_; }
set {
hashCode_ = value;
}
}
/// <summary>Field number for the "maybe_type_name" field.</summary>
public const int MaybeTypeNameFieldNumber = 5;
private string maybeTypeName_ = "";
/// <summary>
/// For debug-only, the name of the type pointed to by this handle, if
/// available.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string MaybeTypeName {
get { return maybeTypeName_; }
set {
maybeTypeName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ResourceHandleProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ResourceHandleProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Device != other.Device) return false;
if (Container != other.Container) return false;
if (Name != other.Name) return false;
if (HashCode != other.HashCode) return false;
if (MaybeTypeName != other.MaybeTypeName) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Device.Length != 0) hash ^= Device.GetHashCode();
if (Container.Length != 0) hash ^= Container.GetHashCode();
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (HashCode != 0UL) hash ^= HashCode.GetHashCode();
if (MaybeTypeName.Length != 0) hash ^= MaybeTypeName.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Device.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Device);
}
if (Container.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Container);
}
if (Name.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Name);
}
if (HashCode != 0UL) {
output.WriteRawTag(32);
output.WriteUInt64(HashCode);
}
if (MaybeTypeName.Length != 0) {
output.WriteRawTag(42);
output.WriteString(MaybeTypeName);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Device.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Device);
}
if (Container.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Container);
}
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (HashCode != 0UL) {
size += 1 + pb::CodedOutputStream.ComputeUInt64Size(HashCode);
}
if (MaybeTypeName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(MaybeTypeName);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ResourceHandleProto other) {
if (other == null) {
return;
}
if (other.Device.Length != 0) {
Device = other.Device;
}
if (other.Container.Length != 0) {
Container = other.Container;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.HashCode != 0UL) {
HashCode = other.HashCode;
}
if (other.MaybeTypeName.Length != 0) {
MaybeTypeName = other.MaybeTypeName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Device = input.ReadString();
break;
}
case 18: {
Container = input.ReadString();
break;
}
case 26: {
Name = input.ReadString();
break;
}
case 32: {
HashCode = input.ReadUInt64();
break;
}
case 42: {
MaybeTypeName = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,640 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/rewriter_config.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/rewriter_config.proto</summary>
public static partial class RewriterConfigReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/rewriter_config.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static RewriterConfigReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ci50ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvcmV3cml0ZXJfY29uZmlnLnBy",
"b3RvEgp0ZW5zb3JmbG93IjsKE0F1dG9QYXJhbGxlbE9wdGlvbnMSDgoGZW5h",
"YmxlGAEgASgIEhQKDG51bV9yZXBsaWNhcxgCIAEoBSKyBQoOUmV3cml0ZXJD",
"b25maWcSOwoQbGF5b3V0X29wdGltaXplchgBIAEoDjIhLnRlbnNvcmZsb3cu",
"UmV3cml0ZXJDb25maWcuVG9nZ2xlEjsKEGNvbnN0YW50X2ZvbGRpbmcYAyAB",
"KA4yIS50ZW5zb3JmbG93LlJld3JpdGVyQ29uZmlnLlRvZ2dsZRJCChdhcml0",
"aG1ldGljX29wdGltaXphdGlvbhgHIAEoDjIhLnRlbnNvcmZsb3cuUmV3cml0",
"ZXJDb25maWcuVG9nZ2xlEkIKF2RlcGVuZGVuY3lfb3B0aW1pemF0aW9uGAgg",
"ASgOMiEudGVuc29yZmxvdy5SZXdyaXRlckNvbmZpZy5Ub2dnbGUSHQoVZGlz",
"YWJsZV9tb2RlbF9wcnVuaW5nGAIgASgIEkIKE21lbW9yeV9vcHRpbWl6YXRp",
"b24YBCABKA4yJS50ZW5zb3JmbG93LlJld3JpdGVyQ29uZmlnLk1lbU9wdFR5",
"cGUSMAoobWVtb3J5X29wdGltaXplcl90YXJnZXRfbm9kZV9uYW1lX3ByZWZp",
"eBgGIAEoCRI2Cg1hdXRvX3BhcmFsbGVsGAUgASgLMh8udGVuc29yZmxvdy5B",
"dXRvUGFyYWxsZWxPcHRpb25zEhIKCm9wdGltaXplcnMYZCADKAkiNgoGVG9n",
"Z2xlEgsKB0RFRkFVTFQQABIGCgJPThABEgcKA09GRhACEg4KCkFHR1JFU1NJ",
"VkUQAyKEAQoKTWVtT3B0VHlwZRITCg9ERUZBVUxUX01FTV9PUFQQABIOCgpO",
"T19NRU1fT1BUEAESCgoGTUFOVUFMEAISFwoTU1dBUFBJTkdfSEVVUklTVElD",
"UxAEEhwKGFJFQ09NUFVUQVRJT05fSEVVUklTVElDUxAFEg4KCkhFVVJJU1RJ",
"Q1MQA0I1ChhvcmcudGVuc29yZmxvdy5mcmFtZXdvcmtCFFJld3JpdGVyQ29u",
"ZmlnUHJvdG9zUAH4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AutoParallelOptions), global::Tensorflow.AutoParallelOptions.Parser, new[]{ "Enable", "NumReplicas" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.RewriterConfig), global::Tensorflow.RewriterConfig.Parser, new[]{ "LayoutOptimizer", "ConstantFolding", "ArithmeticOptimization", "DependencyOptimization", "DisableModelPruning", "MemoryOptimization", "MemoryOptimizerTargetNodeNamePrefix", "AutoParallel", "Optimizers" }, null, new[]{ typeof(global::Tensorflow.RewriterConfig.Types.Toggle), typeof(global::Tensorflow.RewriterConfig.Types.MemOptType) }, null)
}));
}
#endregion
}
#region Messages
public sealed partial class AutoParallelOptions : pb::IMessage<AutoParallelOptions> {
private static readonly pb::MessageParser<AutoParallelOptions> _parser = new pb::MessageParser<AutoParallelOptions>(() => new AutoParallelOptions());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AutoParallelOptions> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.RewriterConfigReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AutoParallelOptions() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AutoParallelOptions(AutoParallelOptions other) : this() {
enable_ = other.enable_;
numReplicas_ = other.numReplicas_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AutoParallelOptions Clone() {
return new AutoParallelOptions(this);
}
/// <summary>Field number for the "enable" field.</summary>
public const int EnableFieldNumber = 1;
private bool enable_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Enable {
get { return enable_; }
set {
enable_ = value;
}
}
/// <summary>Field number for the "num_replicas" field.</summary>
public const int NumReplicasFieldNumber = 2;
private int numReplicas_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int NumReplicas {
get { return numReplicas_; }
set {
numReplicas_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as AutoParallelOptions);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(AutoParallelOptions other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Enable != other.Enable) return false;
if (NumReplicas != other.NumReplicas) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Enable != false) hash ^= Enable.GetHashCode();
if (NumReplicas != 0) hash ^= NumReplicas.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Enable != false) {
output.WriteRawTag(8);
output.WriteBool(Enable);
}
if (NumReplicas != 0) {
output.WriteRawTag(16);
output.WriteInt32(NumReplicas);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Enable != false) {
size += 1 + 1;
}
if (NumReplicas != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumReplicas);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(AutoParallelOptions other) {
if (other == null) {
return;
}
if (other.Enable != false) {
Enable = other.Enable;
}
if (other.NumReplicas != 0) {
NumReplicas = other.NumReplicas;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
Enable = input.ReadBool();
break;
}
case 16: {
NumReplicas = input.ReadInt32();
break;
}
}
}
}
}
/// <summary>
/// Graph rewriting is experimental and subject to change, not covered by any
/// API stability guarantees.
/// </summary>
public sealed partial class RewriterConfig : pb::IMessage<RewriterConfig> {
private static readonly pb::MessageParser<RewriterConfig> _parser = new pb::MessageParser<RewriterConfig>(() => new RewriterConfig());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RewriterConfig> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.RewriterConfigReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RewriterConfig() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RewriterConfig(RewriterConfig other) : this() {
layoutOptimizer_ = other.layoutOptimizer_;
constantFolding_ = other.constantFolding_;
arithmeticOptimization_ = other.arithmeticOptimization_;
dependencyOptimization_ = other.dependencyOptimization_;
disableModelPruning_ = other.disableModelPruning_;
memoryOptimization_ = other.memoryOptimization_;
memoryOptimizerTargetNodeNamePrefix_ = other.memoryOptimizerTargetNodeNamePrefix_;
AutoParallel = other.autoParallel_ != null ? other.AutoParallel.Clone() : null;
optimizers_ = other.optimizers_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RewriterConfig Clone() {
return new RewriterConfig(this);
}
/// <summary>Field number for the "layout_optimizer" field.</summary>
public const int LayoutOptimizerFieldNumber = 1;
private global::Tensorflow.RewriterConfig.Types.Toggle layoutOptimizer_ = 0;
/// <summary>
/// Optimize tensor layouts
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.RewriterConfig.Types.Toggle LayoutOptimizer {
get { return layoutOptimizer_; }
set {
layoutOptimizer_ = value;
}
}
/// <summary>Field number for the "constant_folding" field.</summary>
public const int ConstantFoldingFieldNumber = 3;
private global::Tensorflow.RewriterConfig.Types.Toggle constantFolding_ = 0;
/// <summary>
/// Fold constants (default is ON)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.RewriterConfig.Types.Toggle ConstantFolding {
get { return constantFolding_; }
set {
constantFolding_ = value;
}
}
/// <summary>Field number for the "arithmetic_optimization" field.</summary>
public const int ArithmeticOptimizationFieldNumber = 7;
private global::Tensorflow.RewriterConfig.Types.Toggle arithmeticOptimization_ = 0;
/// <summary>
/// Arithmetic optimizations (default is ON)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.RewriterConfig.Types.Toggle ArithmeticOptimization {
get { return arithmeticOptimization_; }
set {
arithmeticOptimization_ = value;
}
}
/// <summary>Field number for the "dependency_optimization" field.</summary>
public const int DependencyOptimizationFieldNumber = 8;
private global::Tensorflow.RewriterConfig.Types.Toggle dependencyOptimization_ = 0;
/// <summary>
/// Control dependency optimizations (default is OFF).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.RewriterConfig.Types.Toggle DependencyOptimization {
get { return dependencyOptimization_; }
set {
dependencyOptimization_ = value;
}
}
/// <summary>Field number for the "disable_model_pruning" field.</summary>
public const int DisableModelPruningFieldNumber = 2;
private bool disableModelPruning_;
/// <summary>
/// If true, don't remove unnecessary ops from the graph
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool DisableModelPruning {
get { return disableModelPruning_; }
set {
disableModelPruning_ = value;
}
}
/// <summary>Field number for the "memory_optimization" field.</summary>
public const int MemoryOptimizationFieldNumber = 4;
private global::Tensorflow.RewriterConfig.Types.MemOptType memoryOptimization_ = 0;
/// <summary>
/// Configures memory optimization passes through the meta-optimizer. Has no
/// effect on manually requested memory optimization passes in the optimizers
/// field.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.RewriterConfig.Types.MemOptType MemoryOptimization {
get { return memoryOptimization_; }
set {
memoryOptimization_ = value;
}
}
/// <summary>Field number for the "memory_optimizer_target_node_name_prefix" field.</summary>
public const int MemoryOptimizerTargetNodeNamePrefixFieldNumber = 6;
private string memoryOptimizerTargetNodeNamePrefix_ = "";
/// <summary>
/// The prefix for nodes which are valid outputs of recomputations. Inputs to
/// nodes with this name prefix may be recomputed (subject either to manual
/// annotation of those input nodes or to manual annotation and heuristics
/// depending on memory_optimization), but the prefixed nodes themselves will
/// not be recomputed. Typically this will be "gradients/", indicating that
/// activations from the forward pass of a graph may be recomputed as inputs to
/// gradients, but may be adjusted if gradients are inside a name scope or if
/// inputs to non-gradients should be recomputed. Defaults to "gradients/" if
/// empty or not set.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string MemoryOptimizerTargetNodeNamePrefix {
get { return memoryOptimizerTargetNodeNamePrefix_; }
set {
memoryOptimizerTargetNodeNamePrefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "auto_parallel" field.</summary>
public const int AutoParallelFieldNumber = 5;
private global::Tensorflow.AutoParallelOptions autoParallel_;
/// <summary>
/// Configures AutoParallel optimization passes either through the
/// meta-optimizer or when manually specified through the optimizers field.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.AutoParallelOptions AutoParallel {
get { return autoParallel_; }
set {
autoParallel_ = value;
}
}
/// <summary>Field number for the "optimizers" field.</summary>
public const int OptimizersFieldNumber = 100;
private static readonly pb::FieldCodec<string> _repeated_optimizers_codec
= pb::FieldCodec.ForString(802);
private readonly pbc::RepeatedField<string> optimizers_ = new pbc::RepeatedField<string>();
/// <summary>
/// If non-empty, will use this as an alternative way to specify a list of
/// optimizations to turn on and the order of the optimizations (replacing the
/// meta-optimizer).
///
/// Of the RewriterConfig options, only the AutoParallel configuration options
/// (the auto_parallel field) apply to manually requested optimization passes
/// ("autoparallel"). Memory optimization passes ("memory") invoked here are
/// not configurable (in contrast to memory optimization passes through the
/// meta-optimizer) and act only on manual op annotations.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Optimizers {
get { return optimizers_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as RewriterConfig);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(RewriterConfig other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (LayoutOptimizer != other.LayoutOptimizer) return false;
if (ConstantFolding != other.ConstantFolding) return false;
if (ArithmeticOptimization != other.ArithmeticOptimization) return false;
if (DependencyOptimization != other.DependencyOptimization) return false;
if (DisableModelPruning != other.DisableModelPruning) return false;
if (MemoryOptimization != other.MemoryOptimization) return false;
if (MemoryOptimizerTargetNodeNamePrefix != other.MemoryOptimizerTargetNodeNamePrefix) return false;
if (!object.Equals(AutoParallel, other.AutoParallel)) return false;
if(!optimizers_.Equals(other.optimizers_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (LayoutOptimizer != 0) hash ^= LayoutOptimizer.GetHashCode();
if (ConstantFolding != 0) hash ^= ConstantFolding.GetHashCode();
if (ArithmeticOptimization != 0) hash ^= ArithmeticOptimization.GetHashCode();
if (DependencyOptimization != 0) hash ^= DependencyOptimization.GetHashCode();
if (DisableModelPruning != false) hash ^= DisableModelPruning.GetHashCode();
if (MemoryOptimization != 0) hash ^= MemoryOptimization.GetHashCode();
if (MemoryOptimizerTargetNodeNamePrefix.Length != 0) hash ^= MemoryOptimizerTargetNodeNamePrefix.GetHashCode();
if (autoParallel_ != null) hash ^= AutoParallel.GetHashCode();
hash ^= optimizers_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (LayoutOptimizer != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) LayoutOptimizer);
}
if (DisableModelPruning != false) {
output.WriteRawTag(16);
output.WriteBool(DisableModelPruning);
}
if (ConstantFolding != 0) {
output.WriteRawTag(24);
output.WriteEnum((int) ConstantFolding);
}
if (MemoryOptimization != 0) {
output.WriteRawTag(32);
output.WriteEnum((int) MemoryOptimization);
}
if (autoParallel_ != null) {
output.WriteRawTag(42);
output.WriteMessage(AutoParallel);
}
if (MemoryOptimizerTargetNodeNamePrefix.Length != 0) {
output.WriteRawTag(50);
output.WriteString(MemoryOptimizerTargetNodeNamePrefix);
}
if (ArithmeticOptimization != 0) {
output.WriteRawTag(56);
output.WriteEnum((int) ArithmeticOptimization);
}
if (DependencyOptimization != 0) {
output.WriteRawTag(64);
output.WriteEnum((int) DependencyOptimization);
}
optimizers_.WriteTo(output, _repeated_optimizers_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (LayoutOptimizer != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LayoutOptimizer);
}
if (ConstantFolding != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ConstantFolding);
}
if (ArithmeticOptimization != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ArithmeticOptimization);
}
if (DependencyOptimization != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DependencyOptimization);
}
if (DisableModelPruning != false) {
size += 1 + 1;
}
if (MemoryOptimization != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MemoryOptimization);
}
if (MemoryOptimizerTargetNodeNamePrefix.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(MemoryOptimizerTargetNodeNamePrefix);
}
if (autoParallel_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(AutoParallel);
}
size += optimizers_.CalculateSize(_repeated_optimizers_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(RewriterConfig other) {
if (other == null) {
return;
}
if (other.LayoutOptimizer != 0) {
LayoutOptimizer = other.LayoutOptimizer;
}
if (other.ConstantFolding != 0) {
ConstantFolding = other.ConstantFolding;
}
if (other.ArithmeticOptimization != 0) {
ArithmeticOptimization = other.ArithmeticOptimization;
}
if (other.DependencyOptimization != 0) {
DependencyOptimization = other.DependencyOptimization;
}
if (other.DisableModelPruning != false) {
DisableModelPruning = other.DisableModelPruning;
}
if (other.MemoryOptimization != 0) {
MemoryOptimization = other.MemoryOptimization;
}
if (other.MemoryOptimizerTargetNodeNamePrefix.Length != 0) {
MemoryOptimizerTargetNodeNamePrefix = other.MemoryOptimizerTargetNodeNamePrefix;
}
if (other.autoParallel_ != null) {
if (autoParallel_ == null) {
autoParallel_ = new global::Tensorflow.AutoParallelOptions();
}
AutoParallel.MergeFrom(other.AutoParallel);
}
optimizers_.Add(other.optimizers_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
layoutOptimizer_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum();
break;
}
case 16: {
DisableModelPruning = input.ReadBool();
break;
}
case 24: {
constantFolding_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum();
break;
}
case 32: {
memoryOptimization_ = (global::Tensorflow.RewriterConfig.Types.MemOptType) input.ReadEnum();
break;
}
case 42: {
if (autoParallel_ == null) {
autoParallel_ = new global::Tensorflow.AutoParallelOptions();
}
input.ReadMessage(autoParallel_);
break;
}
case 50: {
MemoryOptimizerTargetNodeNamePrefix = input.ReadString();
break;
}
case 56: {
arithmeticOptimization_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum();
break;
}
case 64: {
dependencyOptimization_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum();
break;
}
case 802: {
optimizers_.AddEntriesFrom(input, _repeated_optimizers_codec);
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the RewriterConfig message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
public enum Toggle {
[pbr::OriginalName("DEFAULT")] Default = 0,
[pbr::OriginalName("ON")] On = 1,
[pbr::OriginalName("OFF")] Off = 2,
/// <summary>
/// Enable some aggressive optimizations that use assumptions that TF graphs
/// may break. For example, assume the shape of a placeholder matches its
/// actual feed.
/// </summary>
[pbr::OriginalName("AGGRESSIVE")] Aggressive = 3,
}
public enum MemOptType {
/// <summary>
/// The default setting (currently disabled)
/// </summary>
[pbr::OriginalName("DEFAULT_MEM_OPT")] DefaultMemOpt = 0,
/// <summary>
/// Disabled in the meta-optimizer.
/// </summary>
[pbr::OriginalName("NO_MEM_OPT")] NoMemOpt = 1,
/// <summary>
/// Driven by manual op-level annotations.
/// </summary>
[pbr::OriginalName("MANUAL")] Manual = 2,
/// <summary>
/// Driven by heuristics. The behavior of these heuristics is subject to
/// change. Currently includes an experimental recomputation and swapping
/// heuristics. Manual annotations are respected, but additional nodes are
/// selected automatically.
/// </summary>
[pbr::OriginalName("SWAPPING_HEURISTICS")] SwappingHeuristics = 4,
[pbr::OriginalName("RECOMPUTATION_HEURISTICS")] RecomputationHeuristics = 5,
/// <summary>
/// Use any combination of swapping and recomputation heuristics.
/// </summary>
[pbr::OriginalName("HEURISTICS")] Heuristics = 3,
}
}
#endregion
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,194 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/saved_model.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/saved_model.proto</summary>
public static partial class SavedModelReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/saved_model.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static SavedModelReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cip0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvc2F2ZWRfbW9kZWwucHJvdG8S",
"CnRlbnNvcmZsb3caKXRlbnNvcmZsb3cvY29yZS9wcm90b2J1Zi9tZXRhX2dy",
"YXBoLnByb3RvIl8KClNhdmVkTW9kZWwSIgoac2F2ZWRfbW9kZWxfc2NoZW1h",
"X3ZlcnNpb24YASABKAMSLQoLbWV0YV9ncmFwaHMYAiADKAsyGC50ZW5zb3Jm",
"bG93Lk1ldGFHcmFwaERlZkIxChhvcmcudGVuc29yZmxvdy5mcmFtZXdvcmtC",
"EFNhdmVkTW9kZWxQcm90b3NQAfgBAWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.MetaGraphReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.SavedModel), global::Tensorflow.SavedModel.Parser, new[]{ "SavedModelSchemaVersion", "MetaGraphs" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// SavedModel is the high level serialization format for TensorFlow Models.
/// See [todo: doc links, similar to session_bundle] for more information.
/// </summary>
public sealed partial class SavedModel : pb::IMessage<SavedModel> {
private static readonly pb::MessageParser<SavedModel> _parser = new pb::MessageParser<SavedModel>(() => new SavedModel());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SavedModel> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.SavedModelReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SavedModel() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SavedModel(SavedModel other) : this() {
savedModelSchemaVersion_ = other.savedModelSchemaVersion_;
metaGraphs_ = other.metaGraphs_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SavedModel Clone() {
return new SavedModel(this);
}
/// <summary>Field number for the "saved_model_schema_version" field.</summary>
public const int SavedModelSchemaVersionFieldNumber = 1;
private long savedModelSchemaVersion_;
/// <summary>
/// The schema version of the SavedModel instance. Used for versioning when
/// making future changes to the specification/implementation. Initial value
/// at release will be 1.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long SavedModelSchemaVersion {
get { return savedModelSchemaVersion_; }
set {
savedModelSchemaVersion_ = value;
}
}
/// <summary>Field number for the "meta_graphs" field.</summary>
public const int MetaGraphsFieldNumber = 2;
private static readonly pb::FieldCodec<global::Tensorflow.MetaGraphDef> _repeated_metaGraphs_codec
= pb::FieldCodec.ForMessage(18, global::Tensorflow.MetaGraphDef.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.MetaGraphDef> metaGraphs_ = new pbc::RepeatedField<global::Tensorflow.MetaGraphDef>();
/// <summary>
/// One or more MetaGraphs.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.MetaGraphDef> MetaGraphs {
get { return metaGraphs_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SavedModel);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(SavedModel other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (SavedModelSchemaVersion != other.SavedModelSchemaVersion) return false;
if(!metaGraphs_.Equals(other.metaGraphs_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (SavedModelSchemaVersion != 0L) hash ^= SavedModelSchemaVersion.GetHashCode();
hash ^= metaGraphs_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (SavedModelSchemaVersion != 0L) {
output.WriteRawTag(8);
output.WriteInt64(SavedModelSchemaVersion);
}
metaGraphs_.WriteTo(output, _repeated_metaGraphs_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (SavedModelSchemaVersion != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(SavedModelSchemaVersion);
}
size += metaGraphs_.CalculateSize(_repeated_metaGraphs_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(SavedModel other) {
if (other == null) {
return;
}
if (other.SavedModelSchemaVersion != 0L) {
SavedModelSchemaVersion = other.SavedModelSchemaVersion;
}
metaGraphs_.Add(other.metaGraphs_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
SavedModelSchemaVersion = input.ReadInt64();
break;
}
case 18: {
metaGraphs_.AddEntriesFrom(input, _repeated_metaGraphs_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,386 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/saver.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/saver.proto</summary>
public static partial class SaverReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/saver.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static SaverReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiR0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvc2F2ZXIucHJvdG8SCnRlbnNv",
"cmZsb3cingIKCFNhdmVyRGVmEhwKFGZpbGVuYW1lX3RlbnNvcl9uYW1lGAEg",
"ASgJEhgKEHNhdmVfdGVuc29yX25hbWUYAiABKAkSFwoPcmVzdG9yZV9vcF9u",
"YW1lGAMgASgJEhMKC21heF90b19rZWVwGAQgASgFEg8KB3NoYXJkZWQYBSAB",
"KAgSJQoda2VlcF9jaGVja3BvaW50X2V2ZXJ5X25faG91cnMYBiABKAISPQoH",
"dmVyc2lvbhgHIAEoDjIsLnRlbnNvcmZsb3cuU2F2ZXJEZWYuQ2hlY2twb2lu",
"dEZvcm1hdFZlcnNpb24iNQoXQ2hlY2twb2ludEZvcm1hdFZlcnNpb24SCgoG",
"TEVHQUNZEAASBgoCVjEQARIGCgJWMhACQicKE29yZy50ZW5zb3JmbG93LnV0",
"aWxCC1NhdmVyUHJvdG9zUAH4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.SaverDef), global::Tensorflow.SaverDef.Parser, new[]{ "FilenameTensorName", "SaveTensorName", "RestoreOpName", "MaxToKeep", "Sharded", "KeepCheckpointEveryNHours", "Version" }, null, new[]{ typeof(global::Tensorflow.SaverDef.Types.CheckpointFormatVersion) }, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Protocol buffer representing the configuration of a Saver.
/// </summary>
public sealed partial class SaverDef : pb::IMessage<SaverDef> {
private static readonly pb::MessageParser<SaverDef> _parser = new pb::MessageParser<SaverDef>(() => new SaverDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SaverDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.SaverReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SaverDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SaverDef(SaverDef other) : this() {
filenameTensorName_ = other.filenameTensorName_;
saveTensorName_ = other.saveTensorName_;
restoreOpName_ = other.restoreOpName_;
maxToKeep_ = other.maxToKeep_;
sharded_ = other.sharded_;
keepCheckpointEveryNHours_ = other.keepCheckpointEveryNHours_;
version_ = other.version_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SaverDef Clone() {
return new SaverDef(this);
}
/// <summary>Field number for the "filename_tensor_name" field.</summary>
public const int FilenameTensorNameFieldNumber = 1;
private string filenameTensorName_ = "";
/// <summary>
/// The name of the tensor in which to specify the filename when saving or
/// restoring a model checkpoint.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string FilenameTensorName {
get { return filenameTensorName_; }
set {
filenameTensorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "save_tensor_name" field.</summary>
public const int SaveTensorNameFieldNumber = 2;
private string saveTensorName_ = "";
/// <summary>
/// The operation to run when saving a model checkpoint.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string SaveTensorName {
get { return saveTensorName_; }
set {
saveTensorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "restore_op_name" field.</summary>
public const int RestoreOpNameFieldNumber = 3;
private string restoreOpName_ = "";
/// <summary>
/// The operation to run when restoring a model checkpoint.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string RestoreOpName {
get { return restoreOpName_; }
set {
restoreOpName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "max_to_keep" field.</summary>
public const int MaxToKeepFieldNumber = 4;
private int maxToKeep_;
/// <summary>
/// Maximum number of checkpoints to keep. If 0, no checkpoints are deleted.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int MaxToKeep {
get { return maxToKeep_; }
set {
maxToKeep_ = value;
}
}
/// <summary>Field number for the "sharded" field.</summary>
public const int ShardedFieldNumber = 5;
private bool sharded_;
/// <summary>
/// Shard the save files, one per device that has Variable nodes.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Sharded {
get { return sharded_; }
set {
sharded_ = value;
}
}
/// <summary>Field number for the "keep_checkpoint_every_n_hours" field.</summary>
public const int KeepCheckpointEveryNHoursFieldNumber = 6;
private float keepCheckpointEveryNHours_;
/// <summary>
/// How often to keep an additional checkpoint. If not specified, only the last
/// "max_to_keep" checkpoints are kept; if specified, in addition to keeping
/// the last "max_to_keep" checkpoints, an additional checkpoint will be kept
/// for every n hours of training.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float KeepCheckpointEveryNHours {
get { return keepCheckpointEveryNHours_; }
set {
keepCheckpointEveryNHours_ = value;
}
}
/// <summary>Field number for the "version" field.</summary>
public const int VersionFieldNumber = 7;
private global::Tensorflow.SaverDef.Types.CheckpointFormatVersion version_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.SaverDef.Types.CheckpointFormatVersion Version {
get { return version_; }
set {
version_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SaverDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(SaverDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (FilenameTensorName != other.FilenameTensorName) return false;
if (SaveTensorName != other.SaveTensorName) return false;
if (RestoreOpName != other.RestoreOpName) return false;
if (MaxToKeep != other.MaxToKeep) return false;
if (Sharded != other.Sharded) return false;
if (KeepCheckpointEveryNHours != other.KeepCheckpointEveryNHours) return false;
if (Version != other.Version) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (FilenameTensorName.Length != 0) hash ^= FilenameTensorName.GetHashCode();
if (SaveTensorName.Length != 0) hash ^= SaveTensorName.GetHashCode();
if (RestoreOpName.Length != 0) hash ^= RestoreOpName.GetHashCode();
if (MaxToKeep != 0) hash ^= MaxToKeep.GetHashCode();
if (Sharded != false) hash ^= Sharded.GetHashCode();
if (KeepCheckpointEveryNHours != 0F) hash ^= KeepCheckpointEveryNHours.GetHashCode();
if (Version != 0) hash ^= Version.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (FilenameTensorName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(FilenameTensorName);
}
if (SaveTensorName.Length != 0) {
output.WriteRawTag(18);
output.WriteString(SaveTensorName);
}
if (RestoreOpName.Length != 0) {
output.WriteRawTag(26);
output.WriteString(RestoreOpName);
}
if (MaxToKeep != 0) {
output.WriteRawTag(32);
output.WriteInt32(MaxToKeep);
}
if (Sharded != false) {
output.WriteRawTag(40);
output.WriteBool(Sharded);
}
if (KeepCheckpointEveryNHours != 0F) {
output.WriteRawTag(53);
output.WriteFloat(KeepCheckpointEveryNHours);
}
if (Version != 0) {
output.WriteRawTag(56);
output.WriteEnum((int) Version);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (FilenameTensorName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(FilenameTensorName);
}
if (SaveTensorName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(SaveTensorName);
}
if (RestoreOpName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RestoreOpName);
}
if (MaxToKeep != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxToKeep);
}
if (Sharded != false) {
size += 1 + 1;
}
if (KeepCheckpointEveryNHours != 0F) {
size += 1 + 4;
}
if (Version != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Version);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(SaverDef other) {
if (other == null) {
return;
}
if (other.FilenameTensorName.Length != 0) {
FilenameTensorName = other.FilenameTensorName;
}
if (other.SaveTensorName.Length != 0) {
SaveTensorName = other.SaveTensorName;
}
if (other.RestoreOpName.Length != 0) {
RestoreOpName = other.RestoreOpName;
}
if (other.MaxToKeep != 0) {
MaxToKeep = other.MaxToKeep;
}
if (other.Sharded != false) {
Sharded = other.Sharded;
}
if (other.KeepCheckpointEveryNHours != 0F) {
KeepCheckpointEveryNHours = other.KeepCheckpointEveryNHours;
}
if (other.Version != 0) {
Version = other.Version;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
FilenameTensorName = input.ReadString();
break;
}
case 18: {
SaveTensorName = input.ReadString();
break;
}
case 26: {
RestoreOpName = input.ReadString();
break;
}
case 32: {
MaxToKeep = input.ReadInt32();
break;
}
case 40: {
Sharded = input.ReadBool();
break;
}
case 53: {
KeepCheckpointEveryNHours = input.ReadFloat();
break;
}
case 56: {
version_ = (global::Tensorflow.SaverDef.Types.CheckpointFormatVersion) input.ReadEnum();
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the SaverDef message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// A version number that identifies a different on-disk checkpoint format.
/// Usually, each subclass of BaseSaverBuilder works with a particular
/// version/format. However, it is possible that the same builder may be
/// upgraded to support a newer checkpoint format in the future.
/// </summary>
public enum CheckpointFormatVersion {
/// <summary>
/// Internal legacy format.
/// </summary>
[pbr::OriginalName("LEGACY")] Legacy = 0,
/// <summary>
/// Deprecated format: tf.Saver() which works with tensorflow::table::Table.
/// </summary>
[pbr::OriginalName("V1")] V1 = 1,
/// <summary>
/// Current format: more efficient.
/// </summary>
[pbr::OriginalName("V2")] V2 = 2,
}
}
#endregion
}
#endregion
}
#endregion Designer generated code

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,776 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/tensor.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/tensor.proto</summary>
public static partial class TensorReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/tensor.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static TensorReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiZ0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvci5wcm90bxIKdGVu",
"c29yZmxvdxovdGVuc29yZmxvdy9jb3JlL2ZyYW1ld29yay9yZXNvdXJjZV9o",
"YW5kbGUucHJvdG8aLHRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVuc29y",
"X3NoYXBlLnByb3RvGiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3R5cGVz",
"LnByb3RvIowECgtUZW5zb3JQcm90bxIjCgVkdHlwZRgBIAEoDjIULnRlbnNv",
"cmZsb3cuRGF0YVR5cGUSMgoMdGVuc29yX3NoYXBlGAIgASgLMhwudGVuc29y",
"Zmxvdy5UZW5zb3JTaGFwZVByb3RvEhYKDnZlcnNpb25fbnVtYmVyGAMgASgF",
"EhYKDnRlbnNvcl9jb250ZW50GAQgASgMEhQKCGhhbGZfdmFsGA0gAygFQgIQ",
"ARIVCglmbG9hdF92YWwYBSADKAJCAhABEhYKCmRvdWJsZV92YWwYBiADKAFC",
"AhABEhMKB2ludF92YWwYByADKAVCAhABEhIKCnN0cmluZ192YWwYCCADKAwS",
"GAoMc2NvbXBsZXhfdmFsGAkgAygCQgIQARIVCglpbnQ2NF92YWwYCiADKANC",
"AhABEhQKCGJvb2xfdmFsGAsgAygIQgIQARIYCgxkY29tcGxleF92YWwYDCAD",
"KAFCAhABEjwKE3Jlc291cmNlX2hhbmRsZV92YWwYDiADKAsyHy50ZW5zb3Jm",
"bG93LlJlc291cmNlSGFuZGxlUHJvdG8SNwoLdmFyaWFudF92YWwYDyADKAsy",
"Ii50ZW5zb3JmbG93LlZhcmlhbnRUZW5zb3JEYXRhUHJvdG8SFgoKdWludDMy",
"X3ZhbBgQIAMoDUICEAESFgoKdWludDY0X3ZhbBgRIAMoBEICEAEiZwoWVmFy",
"aWFudFRlbnNvckRhdGFQcm90bxIRCgl0eXBlX25hbWUYASABKAkSEAoIbWV0",
"YWRhdGEYAiABKAwSKAoHdGVuc29ycxgDIAMoCzIXLnRlbnNvcmZsb3cuVGVu",
"c29yUHJvdG9CLQoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQgxUZW5zb3JQ",
"cm90b3NQAfgBAWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.ResourceHandleReflection.Descriptor, global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.TypesReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorProto), global::Tensorflow.TensorProto.Parser, new[]{ "Dtype", "TensorShape", "VersionNumber", "TensorContent", "HalfVal", "FloatVal", "DoubleVal", "IntVal", "StringVal", "ScomplexVal", "Int64Val", "BoolVal", "DcomplexVal", "ResourceHandleVal", "VariantVal", "Uint32Val", "Uint64Val" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.VariantTensorDataProto), global::Tensorflow.VariantTensorDataProto.Parser, new[]{ "TypeName", "Metadata", "Tensors" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Protocol buffer representing a tensor.
/// </summary>
public sealed partial class TensorProto : pb::IMessage<TensorProto> {
private static readonly pb::MessageParser<TensorProto> _parser = new pb::MessageParser<TensorProto>(() => new TensorProto());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TensorProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorProto(TensorProto other) : this() {
dtype_ = other.dtype_;
TensorShape = other.tensorShape_ != null ? other.TensorShape.Clone() : null;
versionNumber_ = other.versionNumber_;
tensorContent_ = other.tensorContent_;
halfVal_ = other.halfVal_.Clone();
floatVal_ = other.floatVal_.Clone();
doubleVal_ = other.doubleVal_.Clone();
intVal_ = other.intVal_.Clone();
stringVal_ = other.stringVal_.Clone();
scomplexVal_ = other.scomplexVal_.Clone();
int64Val_ = other.int64Val_.Clone();
boolVal_ = other.boolVal_.Clone();
dcomplexVal_ = other.dcomplexVal_.Clone();
resourceHandleVal_ = other.resourceHandleVal_.Clone();
variantVal_ = other.variantVal_.Clone();
uint32Val_ = other.uint32Val_.Clone();
uint64Val_ = other.uint64Val_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorProto Clone() {
return new TensorProto(this);
}
/// <summary>Field number for the "dtype" field.</summary>
public const int DtypeFieldNumber = 1;
private global::Tensorflow.DataType dtype_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.DataType Dtype {
get { return dtype_; }
set {
dtype_ = value;
}
}
/// <summary>Field number for the "tensor_shape" field.</summary>
public const int TensorShapeFieldNumber = 2;
private global::Tensorflow.TensorShapeProto tensorShape_;
/// <summary>
/// Shape of the tensor. TODO(touts): sort out the 0-rank issues.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.TensorShapeProto TensorShape {
get { return tensorShape_; }
set {
tensorShape_ = value;
}
}
/// <summary>Field number for the "version_number" field.</summary>
public const int VersionNumberFieldNumber = 3;
private int versionNumber_;
/// <summary>
/// Version number.
///
/// In version 0, if the "repeated xxx" representations contain only one
/// element, that element is repeated to fill the shape. This makes it easy
/// to represent a constant Tensor with a single value.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int VersionNumber {
get { return versionNumber_; }
set {
versionNumber_ = value;
}
}
/// <summary>Field number for the "tensor_content" field.</summary>
public const int TensorContentFieldNumber = 4;
private pb::ByteString tensorContent_ = pb::ByteString.Empty;
/// <summary>
/// Serialized raw tensor content from either Tensor::AsProtoTensorContent or
/// memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
/// can be used for all tensor types. The purpose of this representation is to
/// reduce serialization overhead during RPC call by avoiding serialization of
/// many repeated small items.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString TensorContent {
get { return tensorContent_; }
set {
tensorContent_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "half_val" field.</summary>
public const int HalfValFieldNumber = 13;
private static readonly pb::FieldCodec<int> _repeated_halfVal_codec
= pb::FieldCodec.ForInt32(106);
private readonly pbc::RepeatedField<int> halfVal_ = new pbc::RepeatedField<int>();
/// <summary>
/// DT_HALF. Note that since protobuf has no int16 type, we'll have some
/// pointless zero padding for each value here.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> HalfVal {
get { return halfVal_; }
}
/// <summary>Field number for the "float_val" field.</summary>
public const int FloatValFieldNumber = 5;
private static readonly pb::FieldCodec<float> _repeated_floatVal_codec
= pb::FieldCodec.ForFloat(42);
private readonly pbc::RepeatedField<float> floatVal_ = new pbc::RepeatedField<float>();
/// <summary>
/// DT_FLOAT.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> FloatVal {
get { return floatVal_; }
}
/// <summary>Field number for the "double_val" field.</summary>
public const int DoubleValFieldNumber = 6;
private static readonly pb::FieldCodec<double> _repeated_doubleVal_codec
= pb::FieldCodec.ForDouble(50);
private readonly pbc::RepeatedField<double> doubleVal_ = new pbc::RepeatedField<double>();
/// <summary>
/// DT_DOUBLE.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> DoubleVal {
get { return doubleVal_; }
}
/// <summary>Field number for the "int_val" field.</summary>
public const int IntValFieldNumber = 7;
private static readonly pb::FieldCodec<int> _repeated_intVal_codec
= pb::FieldCodec.ForInt32(58);
private readonly pbc::RepeatedField<int> intVal_ = new pbc::RepeatedField<int>();
/// <summary>
/// DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> IntVal {
get { return intVal_; }
}
/// <summary>Field number for the "string_val" field.</summary>
public const int StringValFieldNumber = 8;
private static readonly pb::FieldCodec<pb::ByteString> _repeated_stringVal_codec
= pb::FieldCodec.ForBytes(66);
private readonly pbc::RepeatedField<pb::ByteString> stringVal_ = new pbc::RepeatedField<pb::ByteString>();
/// <summary>
/// DT_STRING
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<pb::ByteString> StringVal {
get { return stringVal_; }
}
/// <summary>Field number for the "scomplex_val" field.</summary>
public const int ScomplexValFieldNumber = 9;
private static readonly pb::FieldCodec<float> _repeated_scomplexVal_codec
= pb::FieldCodec.ForFloat(74);
private readonly pbc::RepeatedField<float> scomplexVal_ = new pbc::RepeatedField<float>();
/// <summary>
/// DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
/// and imaginary parts of i-th single precision complex.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> ScomplexVal {
get { return scomplexVal_; }
}
/// <summary>Field number for the "int64_val" field.</summary>
public const int Int64ValFieldNumber = 10;
private static readonly pb::FieldCodec<long> _repeated_int64Val_codec
= pb::FieldCodec.ForInt64(82);
private readonly pbc::RepeatedField<long> int64Val_ = new pbc::RepeatedField<long>();
/// <summary>
/// DT_INT64
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<long> Int64Val {
get { return int64Val_; }
}
/// <summary>Field number for the "bool_val" field.</summary>
public const int BoolValFieldNumber = 11;
private static readonly pb::FieldCodec<bool> _repeated_boolVal_codec
= pb::FieldCodec.ForBool(90);
private readonly pbc::RepeatedField<bool> boolVal_ = new pbc::RepeatedField<bool>();
/// <summary>
/// DT_BOOL
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<bool> BoolVal {
get { return boolVal_; }
}
/// <summary>Field number for the "dcomplex_val" field.</summary>
public const int DcomplexValFieldNumber = 12;
private static readonly pb::FieldCodec<double> _repeated_dcomplexVal_codec
= pb::FieldCodec.ForDouble(98);
private readonly pbc::RepeatedField<double> dcomplexVal_ = new pbc::RepeatedField<double>();
/// <summary>
/// DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
/// and imaginary parts of i-th double precision complex.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> DcomplexVal {
get { return dcomplexVal_; }
}
/// <summary>Field number for the "resource_handle_val" field.</summary>
public const int ResourceHandleValFieldNumber = 14;
private static readonly pb::FieldCodec<global::Tensorflow.ResourceHandleProto> _repeated_resourceHandleVal_codec
= pb::FieldCodec.ForMessage(114, global::Tensorflow.ResourceHandleProto.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.ResourceHandleProto> resourceHandleVal_ = new pbc::RepeatedField<global::Tensorflow.ResourceHandleProto>();
/// <summary>
/// DT_RESOURCE
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.ResourceHandleProto> ResourceHandleVal {
get { return resourceHandleVal_; }
}
/// <summary>Field number for the "variant_val" field.</summary>
public const int VariantValFieldNumber = 15;
private static readonly pb::FieldCodec<global::Tensorflow.VariantTensorDataProto> _repeated_variantVal_codec
= pb::FieldCodec.ForMessage(122, global::Tensorflow.VariantTensorDataProto.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.VariantTensorDataProto> variantVal_ = new pbc::RepeatedField<global::Tensorflow.VariantTensorDataProto>();
/// <summary>
/// DT_VARIANT
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.VariantTensorDataProto> VariantVal {
get { return variantVal_; }
}
/// <summary>Field number for the "uint32_val" field.</summary>
public const int Uint32ValFieldNumber = 16;
private static readonly pb::FieldCodec<uint> _repeated_uint32Val_codec
= pb::FieldCodec.ForUInt32(130);
private readonly pbc::RepeatedField<uint> uint32Val_ = new pbc::RepeatedField<uint>();
/// <summary>
/// DT_UINT32
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<uint> Uint32Val {
get { return uint32Val_; }
}
/// <summary>Field number for the "uint64_val" field.</summary>
public const int Uint64ValFieldNumber = 17;
private static readonly pb::FieldCodec<ulong> _repeated_uint64Val_codec
= pb::FieldCodec.ForUInt64(138);
private readonly pbc::RepeatedField<ulong> uint64Val_ = new pbc::RepeatedField<ulong>();
/// <summary>
/// DT_UINT64
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<ulong> Uint64Val {
get { return uint64Val_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TensorProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TensorProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Dtype != other.Dtype) return false;
if (!object.Equals(TensorShape, other.TensorShape)) return false;
if (VersionNumber != other.VersionNumber) return false;
if (TensorContent != other.TensorContent) return false;
if(!halfVal_.Equals(other.halfVal_)) return false;
if(!floatVal_.Equals(other.floatVal_)) return false;
if(!doubleVal_.Equals(other.doubleVal_)) return false;
if(!intVal_.Equals(other.intVal_)) return false;
if(!stringVal_.Equals(other.stringVal_)) return false;
if(!scomplexVal_.Equals(other.scomplexVal_)) return false;
if(!int64Val_.Equals(other.int64Val_)) return false;
if(!boolVal_.Equals(other.boolVal_)) return false;
if(!dcomplexVal_.Equals(other.dcomplexVal_)) return false;
if(!resourceHandleVal_.Equals(other.resourceHandleVal_)) return false;
if(!variantVal_.Equals(other.variantVal_)) return false;
if(!uint32Val_.Equals(other.uint32Val_)) return false;
if(!uint64Val_.Equals(other.uint64Val_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Dtype != 0) hash ^= Dtype.GetHashCode();
if (tensorShape_ != null) hash ^= TensorShape.GetHashCode();
if (VersionNumber != 0) hash ^= VersionNumber.GetHashCode();
if (TensorContent.Length != 0) hash ^= TensorContent.GetHashCode();
hash ^= halfVal_.GetHashCode();
hash ^= floatVal_.GetHashCode();
hash ^= doubleVal_.GetHashCode();
hash ^= intVal_.GetHashCode();
hash ^= stringVal_.GetHashCode();
hash ^= scomplexVal_.GetHashCode();
hash ^= int64Val_.GetHashCode();
hash ^= boolVal_.GetHashCode();
hash ^= dcomplexVal_.GetHashCode();
hash ^= resourceHandleVal_.GetHashCode();
hash ^= variantVal_.GetHashCode();
hash ^= uint32Val_.GetHashCode();
hash ^= uint64Val_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Dtype != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) Dtype);
}
if (tensorShape_ != null) {
output.WriteRawTag(18);
output.WriteMessage(TensorShape);
}
if (VersionNumber != 0) {
output.WriteRawTag(24);
output.WriteInt32(VersionNumber);
}
if (TensorContent.Length != 0) {
output.WriteRawTag(34);
output.WriteBytes(TensorContent);
}
floatVal_.WriteTo(output, _repeated_floatVal_codec);
doubleVal_.WriteTo(output, _repeated_doubleVal_codec);
intVal_.WriteTo(output, _repeated_intVal_codec);
stringVal_.WriteTo(output, _repeated_stringVal_codec);
scomplexVal_.WriteTo(output, _repeated_scomplexVal_codec);
int64Val_.WriteTo(output, _repeated_int64Val_codec);
boolVal_.WriteTo(output, _repeated_boolVal_codec);
dcomplexVal_.WriteTo(output, _repeated_dcomplexVal_codec);
halfVal_.WriteTo(output, _repeated_halfVal_codec);
resourceHandleVal_.WriteTo(output, _repeated_resourceHandleVal_codec);
variantVal_.WriteTo(output, _repeated_variantVal_codec);
uint32Val_.WriteTo(output, _repeated_uint32Val_codec);
uint64Val_.WriteTo(output, _repeated_uint64Val_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Dtype != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dtype);
}
if (tensorShape_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(TensorShape);
}
if (VersionNumber != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(VersionNumber);
}
if (TensorContent.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(TensorContent);
}
size += halfVal_.CalculateSize(_repeated_halfVal_codec);
size += floatVal_.CalculateSize(_repeated_floatVal_codec);
size += doubleVal_.CalculateSize(_repeated_doubleVal_codec);
size += intVal_.CalculateSize(_repeated_intVal_codec);
size += stringVal_.CalculateSize(_repeated_stringVal_codec);
size += scomplexVal_.CalculateSize(_repeated_scomplexVal_codec);
size += int64Val_.CalculateSize(_repeated_int64Val_codec);
size += boolVal_.CalculateSize(_repeated_boolVal_codec);
size += dcomplexVal_.CalculateSize(_repeated_dcomplexVal_codec);
size += resourceHandleVal_.CalculateSize(_repeated_resourceHandleVal_codec);
size += variantVal_.CalculateSize(_repeated_variantVal_codec);
size += uint32Val_.CalculateSize(_repeated_uint32Val_codec);
size += uint64Val_.CalculateSize(_repeated_uint64Val_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TensorProto other) {
if (other == null) {
return;
}
if (other.Dtype != 0) {
Dtype = other.Dtype;
}
if (other.tensorShape_ != null) {
if (tensorShape_ == null) {
tensorShape_ = new global::Tensorflow.TensorShapeProto();
}
TensorShape.MergeFrom(other.TensorShape);
}
if (other.VersionNumber != 0) {
VersionNumber = other.VersionNumber;
}
if (other.TensorContent.Length != 0) {
TensorContent = other.TensorContent;
}
halfVal_.Add(other.halfVal_);
floatVal_.Add(other.floatVal_);
doubleVal_.Add(other.doubleVal_);
intVal_.Add(other.intVal_);
stringVal_.Add(other.stringVal_);
scomplexVal_.Add(other.scomplexVal_);
int64Val_.Add(other.int64Val_);
boolVal_.Add(other.boolVal_);
dcomplexVal_.Add(other.dcomplexVal_);
resourceHandleVal_.Add(other.resourceHandleVal_);
variantVal_.Add(other.variantVal_);
uint32Val_.Add(other.uint32Val_);
uint64Val_.Add(other.uint64Val_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
dtype_ = (global::Tensorflow.DataType) input.ReadEnum();
break;
}
case 18: {
if (tensorShape_ == null) {
tensorShape_ = new global::Tensorflow.TensorShapeProto();
}
input.ReadMessage(tensorShape_);
break;
}
case 24: {
VersionNumber = input.ReadInt32();
break;
}
case 34: {
TensorContent = input.ReadBytes();
break;
}
case 42:
case 45: {
floatVal_.AddEntriesFrom(input, _repeated_floatVal_codec);
break;
}
case 50:
case 49: {
doubleVal_.AddEntriesFrom(input, _repeated_doubleVal_codec);
break;
}
case 58:
case 56: {
intVal_.AddEntriesFrom(input, _repeated_intVal_codec);
break;
}
case 66: {
stringVal_.AddEntriesFrom(input, _repeated_stringVal_codec);
break;
}
case 74:
case 77: {
scomplexVal_.AddEntriesFrom(input, _repeated_scomplexVal_codec);
break;
}
case 82:
case 80: {
int64Val_.AddEntriesFrom(input, _repeated_int64Val_codec);
break;
}
case 90:
case 88: {
boolVal_.AddEntriesFrom(input, _repeated_boolVal_codec);
break;
}
case 98:
case 97: {
dcomplexVal_.AddEntriesFrom(input, _repeated_dcomplexVal_codec);
break;
}
case 106:
case 104: {
halfVal_.AddEntriesFrom(input, _repeated_halfVal_codec);
break;
}
case 114: {
resourceHandleVal_.AddEntriesFrom(input, _repeated_resourceHandleVal_codec);
break;
}
case 122: {
variantVal_.AddEntriesFrom(input, _repeated_variantVal_codec);
break;
}
case 130:
case 128: {
uint32Val_.AddEntriesFrom(input, _repeated_uint32Val_codec);
break;
}
case 138:
case 136: {
uint64Val_.AddEntriesFrom(input, _repeated_uint64Val_codec);
break;
}
}
}
}
}
/// <summary>
/// Protocol buffer representing the serialization format of DT_VARIANT tensors.
/// </summary>
public sealed partial class VariantTensorDataProto : pb::IMessage<VariantTensorDataProto> {
private static readonly pb::MessageParser<VariantTensorDataProto> _parser = new pb::MessageParser<VariantTensorDataProto>(() => new VariantTensorDataProto());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<VariantTensorDataProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public VariantTensorDataProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public VariantTensorDataProto(VariantTensorDataProto other) : this() {
typeName_ = other.typeName_;
metadata_ = other.metadata_;
tensors_ = other.tensors_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public VariantTensorDataProto Clone() {
return new VariantTensorDataProto(this);
}
/// <summary>Field number for the "type_name" field.</summary>
public const int TypeNameFieldNumber = 1;
private string typeName_ = "";
/// <summary>
/// Name of the type of objects being serialized.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string TypeName {
get { return typeName_; }
set {
typeName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "metadata" field.</summary>
public const int MetadataFieldNumber = 2;
private pb::ByteString metadata_ = pb::ByteString.Empty;
/// <summary>
/// Portions of the object that are not Tensors.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString Metadata {
get { return metadata_; }
set {
metadata_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "tensors" field.</summary>
public const int TensorsFieldNumber = 3;
private static readonly pb::FieldCodec<global::Tensorflow.TensorProto> _repeated_tensors_codec
= pb::FieldCodec.ForMessage(26, global::Tensorflow.TensorProto.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.TensorProto> tensors_ = new pbc::RepeatedField<global::Tensorflow.TensorProto>();
/// <summary>
/// Tensors contained within objects being serialized.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.TensorProto> Tensors {
get { return tensors_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as VariantTensorDataProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(VariantTensorDataProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (TypeName != other.TypeName) return false;
if (Metadata != other.Metadata) return false;
if(!tensors_.Equals(other.tensors_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (TypeName.Length != 0) hash ^= TypeName.GetHashCode();
if (Metadata.Length != 0) hash ^= Metadata.GetHashCode();
hash ^= tensors_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (TypeName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(TypeName);
}
if (Metadata.Length != 0) {
output.WriteRawTag(18);
output.WriteBytes(Metadata);
}
tensors_.WriteTo(output, _repeated_tensors_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (TypeName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeName);
}
if (Metadata.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(Metadata);
}
size += tensors_.CalculateSize(_repeated_tensors_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(VariantTensorDataProto other) {
if (other == null) {
return;
}
if (other.TypeName.Length != 0) {
TypeName = other.TypeName;
}
if (other.Metadata.Length != 0) {
Metadata = other.Metadata;
}
tensors_.Add(other.tensors_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
TypeName = input.ReadString();
break;
}
case 18: {
Metadata = input.ReadBytes();
break;
}
case 26: {
tensors_.AddEntriesFrom(input, _repeated_tensors_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,574 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/tensor_bundle.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/tensor_bundle.proto</summary>
public static partial class TensorBundleReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/tensor_bundle.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static TensorBundleReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cix0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvdGVuc29yX2J1bmRsZS5wcm90",
"bxIKdGVuc29yZmxvdxosdGVuc29yZmxvdy9jb3JlL2ZyYW1ld29yay90ZW5z",
"b3Jfc2hhcGUucHJvdG8aLHRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVu",
"c29yX3NsaWNlLnByb3RvGiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3R5",
"cGVzLnByb3RvGih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3ZlcnNpb25z",
"LnByb3RvIrEBChFCdW5kbGVIZWFkZXJQcm90bxISCgpudW1fc2hhcmRzGAEg",
"ASgFEjwKCmVuZGlhbm5lc3MYAiABKA4yKC50ZW5zb3JmbG93LkJ1bmRsZUhl",
"YWRlclByb3RvLkVuZGlhbm5lc3MSJwoHdmVyc2lvbhgDIAEoCzIWLnRlbnNv",
"cmZsb3cuVmVyc2lvbkRlZiIhCgpFbmRpYW5uZXNzEgoKBkxJVFRMRRAAEgcK",
"A0JJRxABItIBChBCdW5kbGVFbnRyeVByb3RvEiMKBWR0eXBlGAEgASgOMhQu",
"dGVuc29yZmxvdy5EYXRhVHlwZRIrCgVzaGFwZRgCIAEoCzIcLnRlbnNvcmZs",
"b3cuVGVuc29yU2hhcGVQcm90bxIQCghzaGFyZF9pZBgDIAEoBRIOCgZvZmZz",
"ZXQYBCABKAMSDAoEc2l6ZRgFIAEoAxIOCgZjcmMzMmMYBiABKAcSLAoGc2xp",
"Y2VzGAcgAygLMhwudGVuc29yZmxvdy5UZW5zb3JTbGljZVByb3RvQi4KE29y",
"Zy50ZW5zb3JmbG93LnV0aWxCElRlbnNvckJ1bmRsZVByb3Rvc1AB+AEBYgZw",
"cm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.TensorSliceReflection.Descriptor, global::Tensorflow.TypesReflection.Descriptor, global::Tensorflow.VersionsReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.BundleHeaderProto), global::Tensorflow.BundleHeaderProto.Parser, new[]{ "NumShards", "Endianness", "Version" }, null, new[]{ typeof(global::Tensorflow.BundleHeaderProto.Types.Endianness) }, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.BundleEntryProto), global::Tensorflow.BundleEntryProto.Parser, new[]{ "Dtype", "Shape", "ShardId", "Offset", "Size", "Crc32C", "Slices" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Special header that is associated with a bundle.
///
/// TODO(zongheng,zhifengc): maybe in the future, we can add information about
/// which binary produced this checkpoint, timestamp, etc. Sometime, these can be
/// valuable debugging information. And if needed, these can be used as defensive
/// information ensuring reader (binary version) of the checkpoint and the writer
/// (binary version) must match within certain range, etc.
/// </summary>
public sealed partial class BundleHeaderProto : pb::IMessage<BundleHeaderProto> {
private static readonly pb::MessageParser<BundleHeaderProto> _parser = new pb::MessageParser<BundleHeaderProto>(() => new BundleHeaderProto());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<BundleHeaderProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorBundleReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BundleHeaderProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BundleHeaderProto(BundleHeaderProto other) : this() {
numShards_ = other.numShards_;
endianness_ = other.endianness_;
Version = other.version_ != null ? other.Version.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BundleHeaderProto Clone() {
return new BundleHeaderProto(this);
}
/// <summary>Field number for the "num_shards" field.</summary>
public const int NumShardsFieldNumber = 1;
private int numShards_;
/// <summary>
/// Number of data files in the bundle.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int NumShards {
get { return numShards_; }
set {
numShards_ = value;
}
}
/// <summary>Field number for the "endianness" field.</summary>
public const int EndiannessFieldNumber = 2;
private global::Tensorflow.BundleHeaderProto.Types.Endianness endianness_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.BundleHeaderProto.Types.Endianness Endianness {
get { return endianness_; }
set {
endianness_ = value;
}
}
/// <summary>Field number for the "version" field.</summary>
public const int VersionFieldNumber = 3;
private global::Tensorflow.VersionDef version_;
/// <summary>
/// Versioning of the tensor bundle format.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.VersionDef Version {
get { return version_; }
set {
version_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as BundleHeaderProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(BundleHeaderProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (NumShards != other.NumShards) return false;
if (Endianness != other.Endianness) return false;
if (!object.Equals(Version, other.Version)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (NumShards != 0) hash ^= NumShards.GetHashCode();
if (Endianness != 0) hash ^= Endianness.GetHashCode();
if (version_ != null) hash ^= Version.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (NumShards != 0) {
output.WriteRawTag(8);
output.WriteInt32(NumShards);
}
if (Endianness != 0) {
output.WriteRawTag(16);
output.WriteEnum((int) Endianness);
}
if (version_ != null) {
output.WriteRawTag(26);
output.WriteMessage(Version);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (NumShards != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumShards);
}
if (Endianness != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Endianness);
}
if (version_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Version);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(BundleHeaderProto other) {
if (other == null) {
return;
}
if (other.NumShards != 0) {
NumShards = other.NumShards;
}
if (other.Endianness != 0) {
Endianness = other.Endianness;
}
if (other.version_ != null) {
if (version_ == null) {
version_ = new global::Tensorflow.VersionDef();
}
Version.MergeFrom(other.Version);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
NumShards = input.ReadInt32();
break;
}
case 16: {
endianness_ = (global::Tensorflow.BundleHeaderProto.Types.Endianness) input.ReadEnum();
break;
}
case 26: {
if (version_ == null) {
version_ = new global::Tensorflow.VersionDef();
}
input.ReadMessage(version_);
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the BundleHeaderProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// An enum indicating the endianness of the platform that produced this
/// bundle. A bundle can only be read by a platform with matching endianness.
/// Defaults to LITTLE, as most modern platforms are little-endian.
///
/// Affects the binary tensor data bytes only, not the metadata in protobufs.
/// </summary>
public enum Endianness {
[pbr::OriginalName("LITTLE")] Little = 0,
[pbr::OriginalName("BIG")] Big = 1,
}
}
#endregion
}
/// <summary>
/// Describes the metadata related to a checkpointed tensor.
/// </summary>
public sealed partial class BundleEntryProto : pb::IMessage<BundleEntryProto> {
private static readonly pb::MessageParser<BundleEntryProto> _parser = new pb::MessageParser<BundleEntryProto>(() => new BundleEntryProto());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<BundleEntryProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorBundleReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BundleEntryProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BundleEntryProto(BundleEntryProto other) : this() {
dtype_ = other.dtype_;
Shape = other.shape_ != null ? other.Shape.Clone() : null;
shardId_ = other.shardId_;
offset_ = other.offset_;
size_ = other.size_;
crc32C_ = other.crc32C_;
slices_ = other.slices_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BundleEntryProto Clone() {
return new BundleEntryProto(this);
}
/// <summary>Field number for the "dtype" field.</summary>
public const int DtypeFieldNumber = 1;
private global::Tensorflow.DataType dtype_ = 0;
/// <summary>
/// The tensor dtype and shape.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.DataType Dtype {
get { return dtype_; }
set {
dtype_ = value;
}
}
/// <summary>Field number for the "shape" field.</summary>
public const int ShapeFieldNumber = 2;
private global::Tensorflow.TensorShapeProto shape_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.TensorShapeProto Shape {
get { return shape_; }
set {
shape_ = value;
}
}
/// <summary>Field number for the "shard_id" field.</summary>
public const int ShardIdFieldNumber = 3;
private int shardId_;
/// <summary>
/// The binary content of the tensor lies in:
/// File "shard_id": bytes [offset, offset + size).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ShardId {
get { return shardId_; }
set {
shardId_ = value;
}
}
/// <summary>Field number for the "offset" field.</summary>
public const int OffsetFieldNumber = 4;
private long offset_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Offset {
get { return offset_; }
set {
offset_ = value;
}
}
/// <summary>Field number for the "size" field.</summary>
public const int SizeFieldNumber = 5;
private long size_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Size {
get { return size_; }
set {
size_ = value;
}
}
/// <summary>Field number for the "crc32c" field.</summary>
public const int Crc32CFieldNumber = 6;
private uint crc32C_;
/// <summary>
/// The CRC32C checksum of the tensor bytes.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint Crc32C {
get { return crc32C_; }
set {
crc32C_ = value;
}
}
/// <summary>Field number for the "slices" field.</summary>
public const int SlicesFieldNumber = 7;
private static readonly pb::FieldCodec<global::Tensorflow.TensorSliceProto> _repeated_slices_codec
= pb::FieldCodec.ForMessage(58, global::Tensorflow.TensorSliceProto.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.TensorSliceProto> slices_ = new pbc::RepeatedField<global::Tensorflow.TensorSliceProto>();
/// <summary>
/// Iff present, this entry represents a partitioned tensor. The previous
/// fields are interpreted as follows:
///
/// "dtype", "shape": describe the full tensor.
/// "shard_id", "offset", "size", "crc32c": all IGNORED.
/// These information for each slice can be looked up in their own
/// BundleEntryProto, keyed by each "slice_name".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.TensorSliceProto> Slices {
get { return slices_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as BundleEntryProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(BundleEntryProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Dtype != other.Dtype) return false;
if (!object.Equals(Shape, other.Shape)) return false;
if (ShardId != other.ShardId) return false;
if (Offset != other.Offset) return false;
if (Size != other.Size) return false;
if (Crc32C != other.Crc32C) return false;
if(!slices_.Equals(other.slices_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Dtype != 0) hash ^= Dtype.GetHashCode();
if (shape_ != null) hash ^= Shape.GetHashCode();
if (ShardId != 0) hash ^= ShardId.GetHashCode();
if (Offset != 0L) hash ^= Offset.GetHashCode();
if (Size != 0L) hash ^= Size.GetHashCode();
if (Crc32C != 0) hash ^= Crc32C.GetHashCode();
hash ^= slices_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Dtype != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) Dtype);
}
if (shape_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Shape);
}
if (ShardId != 0) {
output.WriteRawTag(24);
output.WriteInt32(ShardId);
}
if (Offset != 0L) {
output.WriteRawTag(32);
output.WriteInt64(Offset);
}
if (Size != 0L) {
output.WriteRawTag(40);
output.WriteInt64(Size);
}
if (Crc32C != 0) {
output.WriteRawTag(53);
output.WriteFixed32(Crc32C);
}
slices_.WriteTo(output, _repeated_slices_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Dtype != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dtype);
}
if (shape_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shape);
}
if (ShardId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ShardId);
}
if (Offset != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Offset);
}
if (Size != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Size);
}
if (Crc32C != 0) {
size += 1 + 4;
}
size += slices_.CalculateSize(_repeated_slices_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(BundleEntryProto other) {
if (other == null) {
return;
}
if (other.Dtype != 0) {
Dtype = other.Dtype;
}
if (other.shape_ != null) {
if (shape_ == null) {
shape_ = new global::Tensorflow.TensorShapeProto();
}
Shape.MergeFrom(other.Shape);
}
if (other.ShardId != 0) {
ShardId = other.ShardId;
}
if (other.Offset != 0L) {
Offset = other.Offset;
}
if (other.Size != 0L) {
Size = other.Size;
}
if (other.Crc32C != 0) {
Crc32C = other.Crc32C;
}
slices_.Add(other.slices_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
dtype_ = (global::Tensorflow.DataType) input.ReadEnum();
break;
}
case 18: {
if (shape_ == null) {
shape_ = new global::Tensorflow.TensorShapeProto();
}
input.ReadMessage(shape_);
break;
}
case 24: {
ShardId = input.ReadInt32();
break;
}
case 32: {
Offset = input.ReadInt64();
break;
}
case 40: {
Size = input.ReadInt64();
break;
}
case 53: {
Crc32C = input.ReadFixed32();
break;
}
case 58: {
slices_.AddEntriesFrom(input, _repeated_slices_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,243 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/tensor_description.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/tensor_description.proto</summary>
public static partial class TensorDescriptionReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/tensor_description.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static TensorDescriptionReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjJ0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvcl9kZXNjcmlwdGlv",
"bi5wcm90bxIKdGVuc29yZmxvdxoldGVuc29yZmxvdy9jb3JlL2ZyYW1ld29y",
"ay90eXBlcy5wcm90bxosdGVuc29yZmxvdy9jb3JlL2ZyYW1ld29yay90ZW5z",
"b3Jfc2hhcGUucHJvdG8aNnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvYWxs",
"b2NhdGlvbl9kZXNjcmlwdGlvbi5wcm90byKoAQoRVGVuc29yRGVzY3JpcHRp",
"b24SIwoFZHR5cGUYASABKA4yFC50ZW5zb3JmbG93LkRhdGFUeXBlEisKBXNo",
"YXBlGAIgASgLMhwudGVuc29yZmxvdy5UZW5zb3JTaGFwZVByb3RvEkEKFmFs",
"bG9jYXRpb25fZGVzY3JpcHRpb24YBCABKAsyIS50ZW5zb3JmbG93LkFsbG9j",
"YXRpb25EZXNjcmlwdGlvbkI4ChhvcmcudGVuc29yZmxvdy5mcmFtZXdvcmtC",
"F1RlbnNvckRlc2NyaXB0aW9uUHJvdG9zUAH4AQFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.TypesReflection.Descriptor, global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.AllocationDescriptionReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorDescription), global::Tensorflow.TensorDescription.Parser, new[]{ "Dtype", "Shape", "AllocationDescription" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class TensorDescription : pb::IMessage<TensorDescription> {
private static readonly pb::MessageParser<TensorDescription> _parser = new pb::MessageParser<TensorDescription>(() => new TensorDescription());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TensorDescription> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorDescriptionReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorDescription() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorDescription(TensorDescription other) : this() {
dtype_ = other.dtype_;
Shape = other.shape_ != null ? other.Shape.Clone() : null;
AllocationDescription = other.allocationDescription_ != null ? other.AllocationDescription.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorDescription Clone() {
return new TensorDescription(this);
}
/// <summary>Field number for the "dtype" field.</summary>
public const int DtypeFieldNumber = 1;
private global::Tensorflow.DataType dtype_ = 0;
/// <summary>
/// Data type of tensor elements
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.DataType Dtype {
get { return dtype_; }
set {
dtype_ = value;
}
}
/// <summary>Field number for the "shape" field.</summary>
public const int ShapeFieldNumber = 2;
private global::Tensorflow.TensorShapeProto shape_;
/// <summary>
/// Shape of the tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.TensorShapeProto Shape {
get { return shape_; }
set {
shape_ = value;
}
}
/// <summary>Field number for the "allocation_description" field.</summary>
public const int AllocationDescriptionFieldNumber = 4;
private global::Tensorflow.AllocationDescription allocationDescription_;
/// <summary>
/// Information about the size and allocator used for the data
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.AllocationDescription AllocationDescription {
get { return allocationDescription_; }
set {
allocationDescription_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TensorDescription);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TensorDescription other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Dtype != other.Dtype) return false;
if (!object.Equals(Shape, other.Shape)) return false;
if (!object.Equals(AllocationDescription, other.AllocationDescription)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Dtype != 0) hash ^= Dtype.GetHashCode();
if (shape_ != null) hash ^= Shape.GetHashCode();
if (allocationDescription_ != null) hash ^= AllocationDescription.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Dtype != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) Dtype);
}
if (shape_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Shape);
}
if (allocationDescription_ != null) {
output.WriteRawTag(34);
output.WriteMessage(AllocationDescription);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Dtype != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dtype);
}
if (shape_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shape);
}
if (allocationDescription_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(AllocationDescription);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TensorDescription other) {
if (other == null) {
return;
}
if (other.Dtype != 0) {
Dtype = other.Dtype;
}
if (other.shape_ != null) {
if (shape_ == null) {
shape_ = new global::Tensorflow.TensorShapeProto();
}
Shape.MergeFrom(other.Shape);
}
if (other.allocationDescription_ != null) {
if (allocationDescription_ == null) {
allocationDescription_ = new global::Tensorflow.AllocationDescription();
}
AllocationDescription.MergeFrom(other.AllocationDescription);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
dtype_ = (global::Tensorflow.DataType) input.ReadEnum();
break;
}
case 18: {
if (shape_ == null) {
shape_ = new global::Tensorflow.TensorShapeProto();
}
input.ReadMessage(shape_);
break;
}
case 34: {
if (allocationDescription_ == null) {
allocationDescription_ = new global::Tensorflow.AllocationDescription();
}
input.ReadMessage(allocationDescription_);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,370 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/tensor_shape.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/tensor_shape.proto</summary>
public static partial class TensorShapeReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/tensor_shape.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static TensorShapeReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cix0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvcl9zaGFwZS5wcm90",
"bxIKdGVuc29yZmxvdyJ6ChBUZW5zb3JTaGFwZVByb3RvEi0KA2RpbRgCIAMo",
"CzIgLnRlbnNvcmZsb3cuVGVuc29yU2hhcGVQcm90by5EaW0SFAoMdW5rbm93",
"bl9yYW5rGAMgASgIGiEKA0RpbRIMCgRzaXplGAEgASgDEgwKBG5hbWUYAiAB",
"KAlCMgoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQhFUZW5zb3JTaGFwZVBy",
"b3Rvc1AB+AEBYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorShapeProto), global::Tensorflow.TensorShapeProto.Parser, new[]{ "Dim", "UnknownRank" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorShapeProto.Types.Dim), global::Tensorflow.TensorShapeProto.Types.Dim.Parser, new[]{ "Size", "Name" }, null, null, null)})
}));
}
#endregion
}
#region Messages
/// <summary>
/// Dimensions of a tensor.
/// </summary>
public sealed partial class TensorShapeProto : pb::IMessage<TensorShapeProto> {
private static readonly pb::MessageParser<TensorShapeProto> _parser = new pb::MessageParser<TensorShapeProto>(() => new TensorShapeProto());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TensorShapeProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorShapeReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorShapeProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorShapeProto(TensorShapeProto other) : this() {
dim_ = other.dim_.Clone();
unknownRank_ = other.unknownRank_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorShapeProto Clone() {
return new TensorShapeProto(this);
}
/// <summary>Field number for the "dim" field.</summary>
public const int DimFieldNumber = 2;
private static readonly pb::FieldCodec<global::Tensorflow.TensorShapeProto.Types.Dim> _repeated_dim_codec
= pb::FieldCodec.ForMessage(18, global::Tensorflow.TensorShapeProto.Types.Dim.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.TensorShapeProto.Types.Dim> dim_ = new pbc::RepeatedField<global::Tensorflow.TensorShapeProto.Types.Dim>();
/// <summary>
/// Dimensions of the tensor, such as {"input", 30}, {"output", 40}
/// for a 30 x 40 2D tensor. If an entry has size -1, this
/// corresponds to a dimension of unknown size. The names are
/// optional.
///
/// The order of entries in "dim" matters: It indicates the layout of the
/// values in the tensor in-memory representation.
///
/// The first entry in "dim" is the outermost dimension used to layout the
/// values, the last entry is the innermost dimension. This matches the
/// in-memory layout of RowMajor Eigen tensors.
///
/// If "dim.size()" > 0, "unknown_rank" must be false.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.TensorShapeProto.Types.Dim> Dim {
get { return dim_; }
}
/// <summary>Field number for the "unknown_rank" field.</summary>
public const int UnknownRankFieldNumber = 3;
private bool unknownRank_;
/// <summary>
/// If true, the number of dimensions in the shape is unknown.
///
/// If true, "dim.size()" must be 0.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool UnknownRank {
get { return unknownRank_; }
set {
unknownRank_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TensorShapeProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TensorShapeProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!dim_.Equals(other.dim_)) return false;
if (UnknownRank != other.UnknownRank) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= dim_.GetHashCode();
if (UnknownRank != false) hash ^= UnknownRank.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
dim_.WriteTo(output, _repeated_dim_codec);
if (UnknownRank != false) {
output.WriteRawTag(24);
output.WriteBool(UnknownRank);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += dim_.CalculateSize(_repeated_dim_codec);
if (UnknownRank != false) {
size += 1 + 1;
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TensorShapeProto other) {
if (other == null) {
return;
}
dim_.Add(other.dim_);
if (other.UnknownRank != false) {
UnknownRank = other.UnknownRank;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 18: {
dim_.AddEntriesFrom(input, _repeated_dim_codec);
break;
}
case 24: {
UnknownRank = input.ReadBool();
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the TensorShapeProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// One dimension of the tensor.
/// </summary>
public sealed partial class Dim : pb::IMessage<Dim> {
private static readonly pb::MessageParser<Dim> _parser = new pb::MessageParser<Dim>(() => new Dim());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Dim> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorShapeProto.Descriptor.NestedTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Dim() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Dim(Dim other) : this() {
size_ = other.size_;
name_ = other.name_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Dim Clone() {
return new Dim(this);
}
/// <summary>Field number for the "size" field.</summary>
public const int SizeFieldNumber = 1;
private long size_;
/// <summary>
/// Size of the tensor in that dimension.
/// This value must be >= -1, but values of -1 are reserved for "unknown"
/// shapes (values of -1 mean "unknown" dimension). Certain wrappers
/// that work with TensorShapeProto may fail at runtime when deserializing
/// a TensorShapeProto containing a dim value of -1.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Size {
get { return size_; }
set {
size_ = value;
}
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 2;
private string name_ = "";
/// <summary>
/// Optional name of the tensor dimension.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Dim);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Dim other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Size != other.Size) return false;
if (Name != other.Name) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Size != 0L) hash ^= Size.GetHashCode();
if (Name.Length != 0) hash ^= Name.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Size != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Size);
}
if (Name.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Name);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Size != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Size);
}
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Dim other) {
if (other == null) {
return;
}
if (other.Size != 0L) {
Size = other.Size;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
Size = input.ReadInt64();
break;
}
case 18: {
Name = input.ReadString();
break;
}
}
}
}
}
}
#endregion
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,350 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/tensor_slice.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/tensor_slice.proto</summary>
public static partial class TensorSliceReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/tensor_slice.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static TensorSliceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cix0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvcl9zbGljZS5wcm90",
"bxIKdGVuc29yZmxvdyKAAQoQVGVuc29yU2xpY2VQcm90bxIzCgZleHRlbnQY",
"ASADKAsyIy50ZW5zb3JmbG93LlRlbnNvclNsaWNlUHJvdG8uRXh0ZW50GjcK",
"BkV4dGVudBINCgVzdGFydBgBIAEoAxIQCgZsZW5ndGgYAiABKANIAEIMCgpo",
"YXNfbGVuZ3RoQjIKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IRVGVuc29y",
"U2xpY2VQcm90b3NQAfgBAWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorSliceProto), global::Tensorflow.TensorSliceProto.Parser, new[]{ "Extent" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorSliceProto.Types.Extent), global::Tensorflow.TensorSliceProto.Types.Extent.Parser, new[]{ "Start", "Length" }, new[]{ "HasLength" }, null, null)})
}));
}
#endregion
}
#region Messages
/// <summary>
/// Can only be interpreted if you know the corresponding TensorShape.
/// </summary>
public sealed partial class TensorSliceProto : pb::IMessage<TensorSliceProto> {
private static readonly pb::MessageParser<TensorSliceProto> _parser = new pb::MessageParser<TensorSliceProto>(() => new TensorSliceProto());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TensorSliceProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorSliceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorSliceProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorSliceProto(TensorSliceProto other) : this() {
extent_ = other.extent_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorSliceProto Clone() {
return new TensorSliceProto(this);
}
/// <summary>Field number for the "extent" field.</summary>
public const int ExtentFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.TensorSliceProto.Types.Extent> _repeated_extent_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.TensorSliceProto.Types.Extent.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.TensorSliceProto.Types.Extent> extent_ = new pbc::RepeatedField<global::Tensorflow.TensorSliceProto.Types.Extent>();
/// <summary>
/// Extent of the slice in all tensor dimensions.
///
/// Must have one entry for each of the dimension of the tensor that this
/// slice belongs to. The order of sizes is the same as the order of
/// dimensions in the TensorShape.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.TensorSliceProto.Types.Extent> Extent {
get { return extent_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TensorSliceProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TensorSliceProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!extent_.Equals(other.extent_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= extent_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
extent_.WriteTo(output, _repeated_extent_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += extent_.CalculateSize(_repeated_extent_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TensorSliceProto other) {
if (other == null) {
return;
}
extent_.Add(other.extent_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
extent_.AddEntriesFrom(input, _repeated_extent_codec);
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the TensorSliceProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// Extent of the slice in one dimension.
/// </summary>
public sealed partial class Extent : pb::IMessage<Extent> {
private static readonly pb::MessageParser<Extent> _parser = new pb::MessageParser<Extent>(() => new Extent());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Extent> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorSliceProto.Descriptor.NestedTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Extent() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Extent(Extent other) : this() {
start_ = other.start_;
switch (other.HasLengthCase) {
case HasLengthOneofCase.Length:
Length = other.Length;
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Extent Clone() {
return new Extent(this);
}
/// <summary>Field number for the "start" field.</summary>
public const int StartFieldNumber = 1;
private long start_;
/// <summary>
/// Start index of the slice, starting at 0.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Start {
get { return start_; }
set {
start_ = value;
}
}
/// <summary>Field number for the "length" field.</summary>
public const int LengthFieldNumber = 2;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Length {
get { return hasLengthCase_ == HasLengthOneofCase.Length ? (long) hasLength_ : 0L; }
set {
hasLength_ = value;
hasLengthCase_ = HasLengthOneofCase.Length;
}
}
private object hasLength_;
/// <summary>Enum of possible cases for the "has_length" oneof.</summary>
public enum HasLengthOneofCase {
None = 0,
Length = 2,
}
private HasLengthOneofCase hasLengthCase_ = HasLengthOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HasLengthOneofCase HasLengthCase {
get { return hasLengthCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearHasLength() {
hasLengthCase_ = HasLengthOneofCase.None;
hasLength_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Extent);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Extent other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Start != other.Start) return false;
if (Length != other.Length) return false;
if (HasLengthCase != other.HasLengthCase) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Start != 0L) hash ^= Start.GetHashCode();
if (hasLengthCase_ == HasLengthOneofCase.Length) hash ^= Length.GetHashCode();
hash ^= (int) hasLengthCase_;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Start != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Start);
}
if (hasLengthCase_ == HasLengthOneofCase.Length) {
output.WriteRawTag(16);
output.WriteInt64(Length);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Start != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Start);
}
if (hasLengthCase_ == HasLengthOneofCase.Length) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Length);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Extent other) {
if (other == null) {
return;
}
if (other.Start != 0L) {
Start = other.Start;
}
switch (other.HasLengthCase) {
case HasLengthOneofCase.Length:
Length = other.Length;
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
Start = input.ReadInt64();
break;
}
case 16: {
Length = input.ReadInt64();
break;
}
}
}
}
}
}
#endregion
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,315 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/tensorflow_server.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/tensorflow_server.proto</summary>
public static partial class TensorflowServerReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/tensorflow_server.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static TensorflowServerReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjB0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvdGVuc29yZmxvd19zZXJ2ZXIu",
"cHJvdG8SCnRlbnNvcmZsb3caJXRlbnNvcmZsb3cvY29yZS9wcm90b2J1Zi9j",
"b25maWcucHJvdG8aJnRlbnNvcmZsb3cvY29yZS9wcm90b2J1Zi9jbHVzdGVy",
"LnByb3RvIqUBCglTZXJ2ZXJEZWYSJwoHY2x1c3RlchgBIAEoCzIWLnRlbnNv",
"cmZsb3cuQ2x1c3RlckRlZhIQCghqb2JfbmFtZRgCIAEoCRISCgp0YXNrX2lu",
"ZGV4GAMgASgFEjcKFmRlZmF1bHRfc2Vzc2lvbl9jb25maWcYBCABKAsyFy50",
"ZW5zb3JmbG93LkNvbmZpZ1Byb3RvEhAKCHByb3RvY29sGAUgASgJQi8KGm9y",
"Zy50ZW5zb3JmbG93LmRpc3RydW50aW1lQgxTZXJ2ZXJQcm90b3NQAfgBAWIG",
"cHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.ConfigReflection.Descriptor, global::Tensorflow.ClusterReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ServerDef), global::Tensorflow.ServerDef.Parser, new[]{ "Cluster", "JobName", "TaskIndex", "DefaultSessionConfig", "Protocol" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Defines the configuration of a single TensorFlow server.
/// </summary>
public sealed partial class ServerDef : pb::IMessage<ServerDef> {
private static readonly pb::MessageParser<ServerDef> _parser = new pb::MessageParser<ServerDef>(() => new ServerDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ServerDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.TensorflowServerReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServerDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServerDef(ServerDef other) : this() {
Cluster = other.cluster_ != null ? other.Cluster.Clone() : null;
jobName_ = other.jobName_;
taskIndex_ = other.taskIndex_;
DefaultSessionConfig = other.defaultSessionConfig_ != null ? other.DefaultSessionConfig.Clone() : null;
protocol_ = other.protocol_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServerDef Clone() {
return new ServerDef(this);
}
/// <summary>Field number for the "cluster" field.</summary>
public const int ClusterFieldNumber = 1;
private global::Tensorflow.ClusterDef cluster_;
/// <summary>
/// The cluster of which this server is a member.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.ClusterDef Cluster {
get { return cluster_; }
set {
cluster_ = value;
}
}
/// <summary>Field number for the "job_name" field.</summary>
public const int JobNameFieldNumber = 2;
private string jobName_ = "";
/// <summary>
/// The name of the job of which this server is a member.
///
/// NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
/// that matches this name.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string JobName {
get { return jobName_; }
set {
jobName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "task_index" field.</summary>
public const int TaskIndexFieldNumber = 3;
private int taskIndex_;
/// <summary>
/// The task index of this server in its job.
///
/// NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
/// and a mapping in its `tasks` field for this index.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int TaskIndex {
get { return taskIndex_; }
set {
taskIndex_ = value;
}
}
/// <summary>Field number for the "default_session_config" field.</summary>
public const int DefaultSessionConfigFieldNumber = 4;
private global::Tensorflow.ConfigProto defaultSessionConfig_;
/// <summary>
/// The default configuration for sessions that run on this server.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.ConfigProto DefaultSessionConfig {
get { return defaultSessionConfig_; }
set {
defaultSessionConfig_ = value;
}
}
/// <summary>Field number for the "protocol" field.</summary>
public const int ProtocolFieldNumber = 5;
private string protocol_ = "";
/// <summary>
/// The protocol to be used by this server.
///
/// Acceptable values include: "grpc".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Protocol {
get { return protocol_; }
set {
protocol_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ServerDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ServerDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Cluster, other.Cluster)) return false;
if (JobName != other.JobName) return false;
if (TaskIndex != other.TaskIndex) return false;
if (!object.Equals(DefaultSessionConfig, other.DefaultSessionConfig)) return false;
if (Protocol != other.Protocol) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (cluster_ != null) hash ^= Cluster.GetHashCode();
if (JobName.Length != 0) hash ^= JobName.GetHashCode();
if (TaskIndex != 0) hash ^= TaskIndex.GetHashCode();
if (defaultSessionConfig_ != null) hash ^= DefaultSessionConfig.GetHashCode();
if (Protocol.Length != 0) hash ^= Protocol.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (cluster_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Cluster);
}
if (JobName.Length != 0) {
output.WriteRawTag(18);
output.WriteString(JobName);
}
if (TaskIndex != 0) {
output.WriteRawTag(24);
output.WriteInt32(TaskIndex);
}
if (defaultSessionConfig_ != null) {
output.WriteRawTag(34);
output.WriteMessage(DefaultSessionConfig);
}
if (Protocol.Length != 0) {
output.WriteRawTag(42);
output.WriteString(Protocol);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (cluster_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Cluster);
}
if (JobName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(JobName);
}
if (TaskIndex != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(TaskIndex);
}
if (defaultSessionConfig_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(DefaultSessionConfig);
}
if (Protocol.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Protocol);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ServerDef other) {
if (other == null) {
return;
}
if (other.cluster_ != null) {
if (cluster_ == null) {
cluster_ = new global::Tensorflow.ClusterDef();
}
Cluster.MergeFrom(other.Cluster);
}
if (other.JobName.Length != 0) {
JobName = other.JobName;
}
if (other.TaskIndex != 0) {
TaskIndex = other.TaskIndex;
}
if (other.defaultSessionConfig_ != null) {
if (defaultSessionConfig_ == null) {
defaultSessionConfig_ = new global::Tensorflow.ConfigProto();
}
DefaultSessionConfig.MergeFrom(other.DefaultSessionConfig);
}
if (other.Protocol.Length != 0) {
Protocol = other.Protocol;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (cluster_ == null) {
cluster_ = new global::Tensorflow.ClusterDef();
}
input.ReadMessage(cluster_);
break;
}
case 18: {
JobName = input.ReadString();
break;
}
case 24: {
TaskIndex = input.ReadInt32();
break;
}
case 34: {
if (defaultSessionConfig_ == null) {
defaultSessionConfig_ = new global::Tensorflow.ConfigProto();
}
input.ReadMessage(defaultSessionConfig_);
break;
}
case 42: {
Protocol = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,150 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/types.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/types.proto</summary>
public static partial class TypesReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/types.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static TypesReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3R5cGVzLnByb3RvEgp0ZW5z",
"b3JmbG93KqoGCghEYXRhVHlwZRIOCgpEVF9JTlZBTElEEAASDAoIRFRfRkxP",
"QVQQARINCglEVF9ET1VCTEUQAhIMCghEVF9JTlQzMhADEgwKCERUX1VJTlQ4",
"EAQSDAoIRFRfSU5UMTYQBRILCgdEVF9JTlQ4EAYSDQoJRFRfU1RSSU5HEAcS",
"EAoMRFRfQ09NUExFWDY0EAgSDAoIRFRfSU5UNjQQCRILCgdEVF9CT09MEAoS",
"DAoIRFRfUUlOVDgQCxINCglEVF9RVUlOVDgQDBINCglEVF9RSU5UMzIQDRIP",
"CgtEVF9CRkxPQVQxNhAOEg0KCURUX1FJTlQxNhAPEg4KCkRUX1FVSU5UMTYQ",
"EBINCglEVF9VSU5UMTYQERIRCg1EVF9DT01QTEVYMTI4EBISCwoHRFRfSEFM",
"RhATEg8KC0RUX1JFU09VUkNFEBQSDgoKRFRfVkFSSUFOVBAVEg0KCURUX1VJ",
"TlQzMhAWEg0KCURUX1VJTlQ2NBAXEhAKDERUX0ZMT0FUX1JFRhBlEhEKDURU",
"X0RPVUJMRV9SRUYQZhIQCgxEVF9JTlQzMl9SRUYQZxIQCgxEVF9VSU5UOF9S",
"RUYQaBIQCgxEVF9JTlQxNl9SRUYQaRIPCgtEVF9JTlQ4X1JFRhBqEhEKDURU",
"X1NUUklOR19SRUYQaxIUChBEVF9DT01QTEVYNjRfUkVGEGwSEAoMRFRfSU5U",
"NjRfUkVGEG0SDwoLRFRfQk9PTF9SRUYQbhIQCgxEVF9RSU5UOF9SRUYQbxIR",
"Cg1EVF9RVUlOVDhfUkVGEHASEQoNRFRfUUlOVDMyX1JFRhBxEhMKD0RUX0JG",
"TE9BVDE2X1JFRhByEhEKDURUX1FJTlQxNl9SRUYQcxISCg5EVF9RVUlOVDE2",
"X1JFRhB0EhEKDURUX1VJTlQxNl9SRUYQdRIVChFEVF9DT01QTEVYMTI4X1JF",
"RhB2Eg8KC0RUX0hBTEZfUkVGEHcSEwoPRFRfUkVTT1VSQ0VfUkVGEHgSEgoO",
"RFRfVkFSSUFOVF9SRUYQeRIRCg1EVF9VSU5UMzJfUkVGEHoSEQoNRFRfVUlO",
"VDY0X1JFRhB7QiwKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0ILVHlwZXNQ",
"cm90b3NQAfgBAWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tensorflow.DataType), }, null));
}
#endregion
}
#region Enums
/// <summary>
/// LINT.IfChange
/// </summary>
public enum DataType {
/// <summary>
/// Not a legal value for DataType. Used to indicate a DataType field
/// has not been set.
/// </summary>
[pbr::OriginalName("DT_INVALID")] DtInvalid = 0,
/// <summary>
/// Data types that all computation devices are expected to be
/// capable to support.
/// </summary>
[pbr::OriginalName("DT_FLOAT")] DtFloat = 1,
[pbr::OriginalName("DT_DOUBLE")] DtDouble = 2,
[pbr::OriginalName("DT_INT32")] DtInt32 = 3,
[pbr::OriginalName("DT_UINT8")] DtUint8 = 4,
[pbr::OriginalName("DT_INT16")] DtInt16 = 5,
[pbr::OriginalName("DT_INT8")] DtInt8 = 6,
[pbr::OriginalName("DT_STRING")] DtString = 7,
/// <summary>
/// Single-precision complex
/// </summary>
[pbr::OriginalName("DT_COMPLEX64")] DtComplex64 = 8,
[pbr::OriginalName("DT_INT64")] DtInt64 = 9,
[pbr::OriginalName("DT_BOOL")] DtBool = 10,
/// <summary>
/// Quantized int8
/// </summary>
[pbr::OriginalName("DT_QINT8")] DtQint8 = 11,
/// <summary>
/// Quantized uint8
/// </summary>
[pbr::OriginalName("DT_QUINT8")] DtQuint8 = 12,
/// <summary>
/// Quantized int32
/// </summary>
[pbr::OriginalName("DT_QINT32")] DtQint32 = 13,
/// <summary>
/// Float32 truncated to 16 bits. Only for cast ops.
/// </summary>
[pbr::OriginalName("DT_BFLOAT16")] DtBfloat16 = 14,
/// <summary>
/// Quantized int16
/// </summary>
[pbr::OriginalName("DT_QINT16")] DtQint16 = 15,
/// <summary>
/// Quantized uint16
/// </summary>
[pbr::OriginalName("DT_QUINT16")] DtQuint16 = 16,
[pbr::OriginalName("DT_UINT16")] DtUint16 = 17,
/// <summary>
/// Double-precision complex
/// </summary>
[pbr::OriginalName("DT_COMPLEX128")] DtComplex128 = 18,
[pbr::OriginalName("DT_HALF")] DtHalf = 19,
[pbr::OriginalName("DT_RESOURCE")] DtResource = 20,
/// <summary>
/// Arbitrary C++ data types
/// </summary>
[pbr::OriginalName("DT_VARIANT")] DtVariant = 21,
[pbr::OriginalName("DT_UINT32")] DtUint32 = 22,
[pbr::OriginalName("DT_UINT64")] DtUint64 = 23,
/// <summary>
/// Do not use! These are only for parameters. Every enum above
/// should have a corresponding value below (verified by types_test).
/// </summary>
[pbr::OriginalName("DT_FLOAT_REF")] DtFloatRef = 101,
[pbr::OriginalName("DT_DOUBLE_REF")] DtDoubleRef = 102,
[pbr::OriginalName("DT_INT32_REF")] DtInt32Ref = 103,
[pbr::OriginalName("DT_UINT8_REF")] DtUint8Ref = 104,
[pbr::OriginalName("DT_INT16_REF")] DtInt16Ref = 105,
[pbr::OriginalName("DT_INT8_REF")] DtInt8Ref = 106,
[pbr::OriginalName("DT_STRING_REF")] DtStringRef = 107,
[pbr::OriginalName("DT_COMPLEX64_REF")] DtComplex64Ref = 108,
[pbr::OriginalName("DT_INT64_REF")] DtInt64Ref = 109,
[pbr::OriginalName("DT_BOOL_REF")] DtBoolRef = 110,
[pbr::OriginalName("DT_QINT8_REF")] DtQint8Ref = 111,
[pbr::OriginalName("DT_QUINT8_REF")] DtQuint8Ref = 112,
[pbr::OriginalName("DT_QINT32_REF")] DtQint32Ref = 113,
[pbr::OriginalName("DT_BFLOAT16_REF")] DtBfloat16Ref = 114,
[pbr::OriginalName("DT_QINT16_REF")] DtQint16Ref = 115,
[pbr::OriginalName("DT_QUINT16_REF")] DtQuint16Ref = 116,
[pbr::OriginalName("DT_UINT16_REF")] DtUint16Ref = 117,
[pbr::OriginalName("DT_COMPLEX128_REF")] DtComplex128Ref = 118,
[pbr::OriginalName("DT_HALF_REF")] DtHalfRef = 119,
[pbr::OriginalName("DT_RESOURCE_REF")] DtResourceRef = 120,
[pbr::OriginalName("DT_VARIANT_REF")] DtVariantRef = 121,
[pbr::OriginalName("DT_UINT32_REF")] DtUint32Ref = 122,
[pbr::OriginalName("DT_UINT64_REF")] DtUint64Ref = 123,
}
#endregion
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,233 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/versions.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow {
/// <summary>Holder for reflection information generated from tensorflow/core/framework/versions.proto</summary>
public static partial class VersionsReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/versions.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static VersionsReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3ZlcnNpb25zLnByb3RvEgp0",
"ZW5zb3JmbG93IksKClZlcnNpb25EZWYSEAoIcHJvZHVjZXIYASABKAUSFAoM",
"bWluX2NvbnN1bWVyGAIgASgFEhUKDWJhZF9jb25zdW1lcnMYAyADKAVCLwoY",
"b3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQg5WZXJzaW9uc1Byb3Rvc1AB+AEB",
"YgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.VersionDef), global::Tensorflow.VersionDef.Parser, new[]{ "Producer", "MinConsumer", "BadConsumers" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// Version information for a piece of serialized data
///
/// There are different types of versions for each type of data
/// (GraphDef, etc.), but they all have the same common shape
/// described here.
///
/// Each consumer has "consumer" and "min_producer" versions (specified
/// elsewhere). A consumer is allowed to consume this data if
///
/// producer >= min_producer
/// consumer >= min_consumer
/// consumer not in bad_consumers
/// </summary>
public sealed partial class VersionDef : pb::IMessage<VersionDef> {
private static readonly pb::MessageParser<VersionDef> _parser = new pb::MessageParser<VersionDef>(() => new VersionDef());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<VersionDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.VersionsReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public VersionDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public VersionDef(VersionDef other) : this() {
producer_ = other.producer_;
minConsumer_ = other.minConsumer_;
badConsumers_ = other.badConsumers_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public VersionDef Clone() {
return new VersionDef(this);
}
/// <summary>Field number for the "producer" field.</summary>
public const int ProducerFieldNumber = 1;
private int producer_;
/// <summary>
/// The version of the code that produced this data.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Producer {
get { return producer_; }
set {
producer_ = value;
}
}
/// <summary>Field number for the "min_consumer" field.</summary>
public const int MinConsumerFieldNumber = 2;
private int minConsumer_;
/// <summary>
/// Any consumer below this version is not allowed to consume this data.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int MinConsumer {
get { return minConsumer_; }
set {
minConsumer_ = value;
}
}
/// <summary>Field number for the "bad_consumers" field.</summary>
public const int BadConsumersFieldNumber = 3;
private static readonly pb::FieldCodec<int> _repeated_badConsumers_codec
= pb::FieldCodec.ForInt32(26);
private readonly pbc::RepeatedField<int> badConsumers_ = new pbc::RepeatedField<int>();
/// <summary>
/// Specific consumer versions which are disallowed (e.g. due to bugs).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> BadConsumers {
get { return badConsumers_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as VersionDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(VersionDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Producer != other.Producer) return false;
if (MinConsumer != other.MinConsumer) return false;
if(!badConsumers_.Equals(other.badConsumers_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Producer != 0) hash ^= Producer.GetHashCode();
if (MinConsumer != 0) hash ^= MinConsumer.GetHashCode();
hash ^= badConsumers_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Producer != 0) {
output.WriteRawTag(8);
output.WriteInt32(Producer);
}
if (MinConsumer != 0) {
output.WriteRawTag(16);
output.WriteInt32(MinConsumer);
}
badConsumers_.WriteTo(output, _repeated_badConsumers_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Producer != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Producer);
}
if (MinConsumer != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinConsumer);
}
size += badConsumers_.CalculateSize(_repeated_badConsumers_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(VersionDef other) {
if (other == null) {
return;
}
if (other.Producer != 0) {
Producer = other.Producer;
}
if (other.MinConsumer != 0) {
MinConsumer = other.MinConsumer;
}
badConsumers_.Add(other.badConsumers_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
Producer = input.ReadInt32();
break;
}
case 16: {
MinConsumer = input.ReadInt32();
break;
}
case 26:
case 24: {
badConsumers_.AddEntriesFrom(input, _repeated_badConsumers_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,59 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/worker_service.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Grpc {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/worker_service.proto</summary>
public static partial class WorkerServiceReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/worker_service.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static WorkerServiceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ci10ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvd29ya2VyX3NlcnZpY2UucHJv",
"dG8SD3RlbnNvcmZsb3cuZ3JwYxoldGVuc29yZmxvdy9jb3JlL3Byb3RvYnVm",
"L3dvcmtlci5wcm90bzKZBwoNV29ya2VyU2VydmljZRJICglHZXRTdGF0dXMS",
"HC50ZW5zb3JmbG93LkdldFN0YXR1c1JlcXVlc3QaHS50ZW5zb3JmbG93Lkdl",
"dFN0YXR1c1Jlc3BvbnNlEmYKE0NyZWF0ZVdvcmtlclNlc3Npb24SJi50ZW5z",
"b3JmbG93LkNyZWF0ZVdvcmtlclNlc3Npb25SZXF1ZXN0GicudGVuc29yZmxv",
"dy5DcmVhdGVXb3JrZXJTZXNzaW9uUmVzcG9uc2USZgoTRGVsZXRlV29ya2Vy",
"U2Vzc2lvbhImLnRlbnNvcmZsb3cuRGVsZXRlV29ya2VyU2Vzc2lvblJlcXVl",
"c3QaJy50ZW5zb3JmbG93LkRlbGV0ZVdvcmtlclNlc3Npb25SZXNwb25zZRJU",
"Cg1SZWdpc3RlckdyYXBoEiAudGVuc29yZmxvdy5SZWdpc3RlckdyYXBoUmVx",
"dWVzdBohLnRlbnNvcmZsb3cuUmVnaXN0ZXJHcmFwaFJlc3BvbnNlEloKD0Rl",
"cmVnaXN0ZXJHcmFwaBIiLnRlbnNvcmZsb3cuRGVyZWdpc3RlckdyYXBoUmVx",
"dWVzdBojLnRlbnNvcmZsb3cuRGVyZWdpc3RlckdyYXBoUmVzcG9uc2USRQoI",
"UnVuR3JhcGgSGy50ZW5zb3JmbG93LlJ1bkdyYXBoUmVxdWVzdBocLnRlbnNv",
"cmZsb3cuUnVuR3JhcGhSZXNwb25zZRJRCgxDbGVhbnVwR3JhcGgSHy50ZW5z",
"b3JmbG93LkNsZWFudXBHcmFwaFJlcXVlc3QaIC50ZW5zb3JmbG93LkNsZWFu",
"dXBHcmFwaFJlc3BvbnNlEksKCkNsZWFudXBBbGwSHS50ZW5zb3JmbG93LkNs",
"ZWFudXBBbGxSZXF1ZXN0Gh4udGVuc29yZmxvdy5DbGVhbnVwQWxsUmVzcG9u",
"c2USTQoKUmVjdlRlbnNvchIdLnRlbnNvcmZsb3cuUmVjdlRlbnNvclJlcXVl",
"c3QaHi50ZW5zb3JmbG93LlJlY3ZUZW5zb3JSZXNwb25zZSIAEkIKB0xvZ2dp",
"bmcSGi50ZW5zb3JmbG93LkxvZ2dpbmdSZXF1ZXN0GhsudGVuc29yZmxvdy5M",
"b2dnaW5nUmVzcG9uc2USQgoHVHJhY2luZxIaLnRlbnNvcmZsb3cuVHJhY2lu",
"Z1JlcXVlc3QaGy50ZW5zb3JmbG93LlRyYWNpbmdSZXNwb25zZUIzChpvcmcu",
"dGVuc29yZmxvdy5kaXN0cnVudGltZUITV29ya2VyU2VydmljZVByb3Rvc1AB",
"YgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tensorflow.WorkerReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null));
}
#endregion
}
}
#endregion Designer generated code

Просмотреть файл

@ -0,0 +1,129 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using OpenCvSharp;
using OpenCvSharp.Blob;
namespace BGSObjectDetector
{
public class BGSObjectDetector
{
MOG2 bgs;
Mat blurredFrame = new Mat();
Mat fgMask = new Mat();
Mat fgWOShadows = new Mat();
Mat fgSmoothedMask2 = new Mat();
Mat fgSmoothedMask3 = new Mat();
Mat fgSmoothedMask4 = new Mat();
Mat regionOfInterest = null;
int PRE_BGS_BLUR_SIGMA = 2;
int MEDIAN_BLUR_SIZE = 5;
int GAUSSIAN_BLUR_SIGMA = 4;
int GAUSSIAN_BLUR_THRESHOLD = 50;
static int MIN_BLOB_SIZE = 30;
static SimpleBlobDetector.Params detectorParams = new SimpleBlobDetector.Params
{
//MinDistBetweenBlobs = 10, // 10 pixels between blobs
//MinRepeatability = 1,
//MinThreshold = 100,
//MaxThreshold = 255,
//ThresholdStep = 5,
FilterByArea = true,
MinArea = MIN_BLOB_SIZE,
MaxArea = int.MaxValue,
FilterByCircularity = false,
//FilterByCircularity = true,
//MinCircularity = 0.001f,
FilterByConvexity = false,
//FilterByConvexity = true,
//MinConvexity = 0.001f,
//MaxConvexity = 10,
FilterByInertia = false,
//FilterByInertia = true,
//MinInertiaRatio = 0.001f,
FilterByColor = false
//FilterByColor = true,
//BlobColor = 255 // to extract light blobs
};
SimpleBlobDetector _blobDetector = SimpleBlobDetector.Create(detectorParams);
//public BGSObjectDetector(MOG2 bgs)
public BGSObjectDetector()
{
//this.bgs = bgs;
bgs = new MOG2();
}
public List<Box> DetectObjects(DateTime timestamp, Mat image, int frameIndex, out Mat fg)
{
if (regionOfInterest != null)
bgs.SetRegionOfInterest(regionOfInterest);
Cv2.GaussianBlur(image, blurredFrame, new OpenCvSharp.Size(0, 0), PRE_BGS_BLUR_SIGMA);
// fgMask is the original foreground bitmap returned by opencv MOG2
fgMask = bgs.DetectForeground(blurredFrame, frameIndex);
fg = fgMask;
if (fgMask == null)
return null;
// pre-processing
Cv2.Threshold(fgMask, fgWOShadows, 200, 255, ThresholdTypes.Binary);
Cv2.MedianBlur(fgWOShadows, fgSmoothedMask2, MEDIAN_BLUR_SIZE);
Cv2.GaussianBlur(fgSmoothedMask2, fgSmoothedMask3, new OpenCvSharp.Size(0, 0), GAUSSIAN_BLUR_SIGMA);
Cv2.Threshold(fgSmoothedMask3, fgSmoothedMask4, GAUSSIAN_BLUR_THRESHOLD, 255, ThresholdTypes.Binary);
fg = fgSmoothedMask4;
CvBlobs blobs = new CvBlobs();
KeyPoint[] points = _blobDetector.Detect(fgSmoothedMask4);
//blobs.FilterByArea(MIN_BLOB_SIZE, int.MaxValue);
//// filter overlapping blobs
//HashSet<uint> blobIdsToRemove = new HashSet<uint>();
//foreach (var b0 in blobs)
// foreach (var b1 in blobs)
// {
// if (b0.Key == b1.Key) continue;
// if (b0.Value.BoundingBox.Contains(b1.Value.BoundingBox))
// blobIdsToRemove.Add(b1.Key);
// }
//foreach (uint blobid in blobIdsToRemove)
// blobs.Remove(blobid);
// adding text to boxes and foreground frame
List<Box> newBlobs = new List<Box>();
uint id = 0;
foreach (var point in points)
{
int x = (int)point.Pt.X;
int y = (int)point.Pt.Y;
int size = (int)point.Size;
Box box = new Box("", x - size, x + size, y - size, y + size, frameIndex, id);
id++;
newBlobs.Add(box);
Cv2.Rectangle(fgSmoothedMask4, new OpenCvSharp.Point(x - size, y - size), new OpenCvSharp.Point(x + size, y + size), new Scalar(255), 1);
Cv2.PutText(fgSmoothedMask4, box.ID.ToString(), new OpenCvSharp.Point(x, y - size), HersheyFonts.HersheyPlain, 1.0, new Scalar(255.0, 255.0, 255.0));
}
Cv2.PutText(fgSmoothedMask4, "frame: " + frameIndex, new OpenCvSharp.Point(10, 10), HersheyFonts.HersheyPlain, 1, new Scalar(255, 255, 255));
newBlobs.ForEach(b => b.Time = timestamp);
newBlobs.ForEach(b => b.Timestamp = frameIndex);
return newBlobs;
}
}
}

Просмотреть файл

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<ApplicationIcon />
<StartupObject />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenCvSharp4" Version="4.0.0.20190108" />
<PackageReference Include="OpenCvSharp4.runtime.ubuntu.18.04-x64" Version="4.0.0.20190108" />
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.0.0.20190108" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,85 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Drawing;
using OpenCvSharp;
namespace BGSObjectDetector
{
public class Box
{
public Rectangle Rectangle { get; private set; }
public uint ID { get; private set; }
public string ObjectCategory { get; private set; }
public int Timestamp { get; set; }
public DateTime? Time { get; set; }
public int X0 { get { return Rectangle.X; } }
public int X1 { get { return Rectangle.X + Rectangle.Width; } }
public int Y0 { get { return Rectangle.Y; } }
public int Y1 { get { return Rectangle.Y + Rectangle.Height; } }
public float[] Center { get { return new float[2] { X0 + Width / 2, Y0 + Height / 2 }; } }
public int Width { get { return Rectangle.Width; } }
public int Height { get { return Rectangle.Height; } }
public int Area { get { return Width * Height; } }
public bool IsEligibleToStartTrack { get; set; }
public bool IsPointInterior(int x, int y)
{
System.Diagnostics.Debug.Assert(X0 < X1);
System.Diagnostics.Debug.Assert(Y0 < Y1);
return Rectangle.Contains(x, y);
}
// for storing histogram value
public float[] hist;
public void SetHist(float[] h)
{
for (int i = 0; i < h.Length; i++) { hist[i] = h[i]; }
}
// for storing feature values
public Mat desc;
public void SetDesc(Mat d)
{
try { desc = d.Clone(); }
catch (Exception) {; }
}
//public Box(string objectCategory, int x0, int x1, int y0, int y1, int timestamp, uint id = 0) // old
public Box(string objectCategory, int x0, int x1, int y0, int y1, int timestamp, uint id = 0, DateTime? time = null, bool isEligibleToStartTrack = true)
{
this.ObjectCategory = objectCategory;
this.Timestamp = timestamp;
this.Time = time;
this.Rectangle = new Rectangle(x0, y0, x1 - x0, y1 - y0);
//this.X0 = x0;
//this.X1 = x1;
//this.Y0 = y0;
//this.Y1 = y1;
this.ID = id;
this.IsEligibleToStartTrack = isEligibleToStartTrack;
// used for different similarity metrics
this.hist = new float[256];
this.desc = null;
}
public static double MaxOverlapFraction(Box b0, Box b1)
{
Rectangle intersection = Rectangle.Intersect(b0.Rectangle, b1.Rectangle);
double f0 = (intersection.Width * intersection.Height) / (double)(b0.Width * b0.Height);
double f1 = (intersection.Width * intersection.Height) / (double)(b1.Width * b1.Height);
return Math.Max(f0, f1);
}
}
}

Просмотреть файл

@ -0,0 +1,48 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using OpenCvSharp;
namespace BGSObjectDetector
{
class MOG2
{
BackgroundSubtractorMOG2 fgDetector = BackgroundSubtractorMOG2.Create(500, 10); //try sweeping (also set it higher than 25)
Mat regionOfInterest = null;
Mat fgMask0 = new Mat();
Mat fgMask = new Mat();
int N_FRAMES_TO_LEARN = 120; // Why do we need this?
public MOG2()
{
regionOfInterest = null;
fgMask0 = new Mat();
fgMask = new Mat();
}
public Mat DetectForeground(Mat image, int nFrames)
{
fgDetector.Apply(image, fgMask0);
if (regionOfInterest != null)
Cv2.BitwiseAnd(fgMask0, regionOfInterest, fgMask);
if (nFrames < N_FRAMES_TO_LEARN)
return null;
else if (regionOfInterest != null)
return fgMask;
else
return fgMask0;
}
public void SetRegionOfInterest(Mat roi)
{
if (roi != null)
{
regionOfInterest = new Mat();
roi.CopyTo(regionOfInterest);
}
}
}
}

Просмотреть файл

@ -0,0 +1,20 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace DNNDetector.Config
{
public static class DNNConfig
{
public static double CONFIDENCE_THRESHOLD { get; set; } = 0.7; //threshold for calling heavy DNN
public static int FRAME_SEARCH_RANGE { get; set; } = 2; // frames
public static int ValidRange { get; set; } = 200; // pixels. Deprecated with overlap checking instead.
public static double MIN_SCORE_FOR_TFOBJECT_OUTPUT { get; set; } = 0.5; //TFWrapper.cs
public static double MIN_SCORE_FOR_LINEBBOX_OVERLAP_SMALL { get; set; } = 0;
public static double MIN_SCORE_FOR_LINEBBOX_OVERLAP_LARGE { get; set; } = 0.2;
}
}

Просмотреть файл

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,57 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Drawing;
namespace DNNDetector.Model
{
public class Item
{
public string ObjName { get; set; }
public double Confidence { get; set; }
public int X { get; set; }
public int Y { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public int ObjId { get; set; }
public int TrackId { get; set; }
public int Index { get; set; }
public byte[] RawImageData { get; set; }
public byte[] TaggedImageData { get; set; }
public byte[] CroppedImageData { get; set; }
public string TriggerLine { get; set; }
public int TriggerLineID { get; set; }
public string Model { get; set; }
public Item(int x, int y, int width, int height, int catId, string catName, double confidence, int lineID, string lineName)
{
this.X = x;
this.Y = y;
this.Width = width;
this.Height = height;
this.ObjId = catId;
this.ObjName = catName;
this.Confidence = confidence;
this.TriggerLineID = lineID;
this.TriggerLine = lineName;
}
public Point Center()
{
return new Point(this.X + this.Width / 2, this.Y + this.Height / 2);
}
public float[] CenterVec()
{
float[] vec = { this.X + this.Width / 2, this.Y + this.Height / 2 };
return vec;
}
public void Print()
{
Console.WriteLine("{0} {1,-5} {2} {3,-5} {4} {5,-5} {6} {7,-10} {8} {9,-10:N2}",
"Index:", Index, "ObjID:", ObjId, "TrackID:", TrackId, "Type:", ObjName, "Conf:", Confidence);
}
}
}

Просмотреть файл

@ -0,0 +1,111 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using DNNDetector.Config;
using DNNDetector.Model;
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.IO;
using Utils.Config;
using Wrapper.Yolo;
using Wrapper.Yolo.Model;
namespace DarknetDetector
{
public class CascadedDNNDarknet
{
static string YOLOCONFIG = "YoloV3Coco"; // "cheap" yolo config folder name
FrameDNNDarknet frameDNNYolo;
FrameBuffer frameBufferCcDNN;
public CascadedDNNDarknet(double rFactor)
{
frameBufferCcDNN = new FrameBuffer(DNNConfig.FRAME_SEARCH_RANGE);
frameDNNYolo = new FrameDNNDarknet(YOLOCONFIG, DNNMode.CC, rFactor);
Utils.Utils.cleanFolder(@OutputFolder.OutputFolderCcDNN);
}
public CascadedDNNDarknet(List<Tuple<string, int[]>> lines)
{
frameBufferCcDNN = new FrameBuffer(DNNConfig.FRAME_SEARCH_RANGE);
frameDNNYolo = new FrameDNNDarknet(YOLOCONFIG, DNNMode.CC, lines);
Utils.Utils.cleanFolder(@OutputFolder.OutputFolderCcDNN);
}
public List<Item> Run(Mat frame, int frameIndex, List<Item> ltDNNItemList, List<Tuple<string, int[]>> lines, Dictionary<string, int> category)
{
if (ltDNNItemList == null)
{
return null;
}
List<Item> ccDNNItem = new List<Item>();
foreach (Item ltDNNItem in ltDNNItemList)
{
if (ltDNNItem.Confidence >= DNNConfig.CONFIDENCE_THRESHOLD)
{
ccDNNItem.Add(ltDNNItem);
continue;
}
else
{
List<YoloTrackingItem> analyzedTrackingItems = null;
int subLineID = lines[ltDNNItem.TriggerLineID].Item2.Length;
frameDNNYolo.SetTrackingPoint(new System.Drawing.Point((int)((lines[ltDNNItem.TriggerLineID].Item2[subLineID - 4] + lines[ltDNNItem.TriggerLineID].Item2[subLineID - 2]) / 2),
(int)((lines[ltDNNItem.TriggerLineID].Item2[subLineID - 3] + lines[ltDNNItem.TriggerLineID].Item2[subLineID - 1]) / 2))); //only needs to check the last line in each row
byte[] imgByte = ltDNNItem.RawImageData;
Console.WriteLine("** Calling Heavy");
analyzedTrackingItems = frameDNNYolo.Detect(imgByte, category, ltDNNItem.TriggerLineID, System.Drawing.Brushes.Red, DNNConfig.MIN_SCORE_FOR_LINEBBOX_OVERLAP_SMALL, frameIndex);
// object detected by heavy YOLO
if (analyzedTrackingItems != null)
{
foreach (YoloTrackingItem yoloTrackingItem in analyzedTrackingItems)
{
Item item = Item(yoloTrackingItem);
item.RawImageData = imgByte;
item.TriggerLine = ltDNNItem.TriggerLine;
item.TriggerLineID = ltDNNItem.TriggerLineID;
item.Model = "Heavy";
ccDNNItem.Add(item);
// output heavy YOLO results
string blobName_Heavy = $@"frame-{frameIndex}-Heavy-{yoloTrackingItem.Confidence}.jpg";
string fileName_Heavy = @OutputFolder.OutputFolderCcDNN + blobName_Heavy;
File.WriteAllBytes(fileName_Heavy, yoloTrackingItem.TaggedImageData);
File.WriteAllBytes(@OutputFolder.OutputFolderAll + blobName_Heavy, yoloTrackingItem.TaggedImageData);
return ccDNNItem; // if we only return the closest object detected by heavy model
}
}
else
{
Console.WriteLine("**Not detected by Heavy");
}
}
}
return ccDNNItem;
}
Item Item(YoloTrackingItem yoloTrackingItem)
{
Item item = new Item(yoloTrackingItem.X, yoloTrackingItem.Y, yoloTrackingItem.Width, yoloTrackingItem.Height,
yoloTrackingItem.ObjId, yoloTrackingItem.Type, yoloTrackingItem.Confidence, 0, "");
item.TrackId = yoloTrackingItem.TrackId;
item.Index = yoloTrackingItem.Index;
item.TaggedImageData = yoloTrackingItem.TaggedImageData;
item.CroppedImageData = yoloTrackingItem.CroppedImageData;
return item;
}
}
}

Просмотреть файл

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenCvSharp4" Version="4.0.0.20190108" />
<PackageReference Include="OpenCvSharp4.runtime.ubuntu.18.04-x64" Version="4.0.0.20190108" />
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.0.0.20190108" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DNNDetector\DNNDetector.csproj" />
<ProjectReference Include="..\TFWrapper\TFWrapper.csproj" />
<ProjectReference Include="..\Utils\Utils.csproj" />
<ProjectReference Include="..\YoloWrapper\YoloWrapper.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using System.Text;
using OpenCvSharp;
namespace DarknetDetector
{
class FrameBuffer
{
Queue<Mat> frameBuffer;
int bSize;
public FrameBuffer(int size)
{
bSize = size;
frameBuffer = new Queue<Mat>(bSize);
}
public void Buffer(Mat frame)
{
frameBuffer.Enqueue(frame);
if (frameBuffer.Count > bSize)
frameBuffer.Dequeue();
}
public Mat[] ToArray()
{
return frameBuffer.ToArray();
}
}
}

Просмотреть файл

@ -0,0 +1,171 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using DNNDetector.Config;
using DNNDetector.Model;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using Utils.Config;
using Wrapper.Yolo;
using Wrapper.Yolo.Model;
namespace DarknetDetector
{
public class FrameDNNDarknet
{
YoloWrapper frameYolo;
YoloTracking frameYoloTracking;
List<Tuple<string, int[]>> _lines;
//distance-based validation
public FrameDNNDarknet(string modelConfig, DNNMode dnnMode, double rFactor)
{
var configurationDetector = new ConfigurationDetector(modelConfig);
frameYolo = new YoloWrapper(configurationDetector.Detect(), dnnMode);
frameYoloTracking = new YoloTracking(frameYolo, Convert.ToInt32(DNNConfig.ValidRange * rFactor));
}
//overlap ratio-based validation
public FrameDNNDarknet(string modelConfig, DNNMode dnnMode, List<Tuple<string, int[]>> lines)
{
var configurationDetector = new ConfigurationDetector(modelConfig);
frameYolo = new YoloWrapper(configurationDetector.Detect(), dnnMode);
frameYoloTracking = new YoloTracking(frameYolo);
_lines = lines;
}
//without validation i.e., output all yolo detections
public FrameDNNDarknet(string modelConfig, DNNMode dnnMode)
{
var configurationDetector = new ConfigurationDetector(modelConfig);
frameYolo = new YoloWrapper(configurationDetector.Detect(), dnnMode);
frameYoloTracking = new YoloTracking(frameYolo);
}
public void SetTrackingPoint(Point trackingObject)
{
frameYoloTracking.SetTrackingObject(trackingObject);
}
public List<YoloTrackingItem> Detect(byte[] imgByte, Dictionary<string, int> cat, int lineID, Brush bboxColor, double min_score_for_linebbox_overlap, int frameIndex = 0)
{
IEnumerable<YoloTrackingItem> yoloItems = frameYoloTracking.Analyse(imgByte, cat, bboxColor);
return OverlapVal(imgByte, yoloItems, lineID, bboxColor, min_score_for_linebbox_overlap);
}
List<YoloTrackingItem> OverlapVal(byte[] imgByte, IEnumerable<YoloTrackingItem> yoloItems, int lineID, Brush bboxColor, double min_score_for_linebbox_overlap)
{
var image = Image.FromStream(new MemoryStream(imgByte)); // to filter out bbox larger than the frame
if (yoloItems == null) return null;
//run overlap ratio-based validation
if (_lines != null)
{
List<YoloTrackingItem> validObjects = new List<YoloTrackingItem>();
////--------------Output images with all bboxes----------------
//byte[] canvas = new byte[imgByte.Length];
//canvas = imgByte;
//YoloTrackingItem[] dbItems = yoloItems.ToArray();
//double dbOverlap;
//foreach (var dbItem in dbItems)
//{
// dbOverlap = Utils.Utils.checkLineBboxOverlapRatio(lines[lineID].Item2, dbItem.X, dbItem.Y, dbItem.Width, dbItem.Height);
// canvas = Utils.Utils.DrawImage(canvas, dbItem.X, dbItem.Y, dbItem.Width, dbItem.Height, bboxColor, dbOverlap.ToString());
//}
//File.WriteAllBytes(@OutputFolder.OutputFolderAll + $"tmp-{frameIndex}-{lines[lineID].Item1}.jpg", canvas);
////--------------Output images with all bboxes----------------
var overlapItems = yoloItems.Select(o => new { Overlap = Utils.Utils.checkLineBboxOverlapRatio(_lines[lineID].Item2, o.X, o.Y, o.Width, o.Height), Bbox_x = o.X + o.Width, Bbox_y = o.Y + o.Height, Distance = this.Distance(_lines[lineID].Item2, o.Center()), Item = o })
.Where(o => o.Bbox_x <= image.Width && o.Bbox_y <= image.Height && o.Overlap >= min_score_for_linebbox_overlap).OrderBy(o => o.Distance);
foreach (var item in overlapItems)
{
var taggedImageData = Utils.Utils.DrawImage(imgByte, item.Item.X, item.Item.Y, item.Item.Width, item.Item.Height, bboxColor);
var croppedImageData = Utils.Utils.CropImage(imgByte, item.Item.X, item.Item.Y, item.Item.Width, item.Item.Height);
validObjects.Add(new YoloTrackingItem(item.Item, frameYoloTracking._index, taggedImageData, croppedImageData));
frameYoloTracking._index++;
}
return (validObjects.Count == 0 ? null : validObjects);
}
else
{
return yoloItems.ToList();
}
}
public List<Item> Run(byte[] imgByte, int frameIndex, List<Tuple<string, int[]>> lines, Dictionary<string, int> cat, Brush bboxColor)
{
List<Item> frameDNNItem = new List<Item>();
IEnumerable<YoloTrackingItem> yoloItems = frameYoloTracking.Analyse(imgByte, cat, bboxColor);
for (int lineID = 0; lineID < lines.Count; lineID++)
{
int subLineID = lines[lineID].Item2.Length;
frameYoloTracking.SetTrackingObject(new Point((int)((lines[lineID].Item2[subLineID - 4] + lines[lineID].Item2[subLineID - 2]) / 2),
(int)((lines[lineID].Item2[subLineID - 3] + lines[lineID].Item2[subLineID - 1]) / 2)));
List<YoloTrackingItem> analyzedTrackingItems = OverlapVal(imgByte, yoloItems, lineID, bboxColor, DNNConfig.MIN_SCORE_FOR_LINEBBOX_OVERLAP_LARGE);
if (analyzedTrackingItems == null) continue;
foreach (YoloTrackingItem yoloTrackingItem in analyzedTrackingItems)
{
Item it = Item(yoloTrackingItem);
it.RawImageData = imgByte;
it.TriggerLineID = lineID;
it.TriggerLine = lines[lineID].Item1;
frameDNNItem.Add(it);
//--------------output frameDNN results - one bbox per image--------------
string blobName_FrameDNN = $@"frame-{frameIndex}-FrameDNN-{yoloTrackingItem.Confidence}.jpg";
string fileName_FrameDNN = @OutputFolder.OutputFolderFrameDNNDarknet + blobName_FrameDNN;
File.WriteAllBytes(fileName_FrameDNN, yoloTrackingItem.TaggedImageData);
//File.WriteAllBytes(@OutputFolder.OutputFolderAll + blobName_FrameDNN, yoloTrackingItem.TaggedImageData);
//--------------output frameDNN results - one bbox per image--------------
}
DrawAllBb(frameIndex, imgByte, analyzedTrackingItems, bboxColor);
}
return frameDNNItem;
}
private double Distance(int[] line, Point bboxCenter)
{
Point p1 = new Point((int)((line[0] + line [2])/2), (int)((line[1]+line[3])/2));
return Math.Sqrt(this.Pow2(bboxCenter.X - p1.X) + Pow2(bboxCenter.Y - p1.Y));
}
private double Pow2(double x)
{
return x * x;
}
private void DrawAllBb(int frameIndex, byte[] imgByte, List<YoloTrackingItem> items, Brush bboxColor)
{
byte[] canvas = new byte[imgByte.Length];
canvas = imgByte;
foreach (var item in items)
{
canvas = Utils.Utils.DrawImage(canvas, item.X, item.Y, item.Width, item.Height, bboxColor);
}
File.WriteAllBytes(@OutputFolder.OutputFolderAll + $"frame-{frameIndex}.jpg", canvas);
}
Item Item(YoloTrackingItem yoloTrackingItem)
{
Item item = new Item(yoloTrackingItem.X, yoloTrackingItem.Y, yoloTrackingItem.Width, yoloTrackingItem.Height,
yoloTrackingItem.ObjId, yoloTrackingItem.Type, yoloTrackingItem.Confidence, 0, "");
item.TrackId = yoloTrackingItem.TrackId;
item.Index = yoloTrackingItem.Index;
item.TaggedImageData = yoloTrackingItem.TaggedImageData;
item.CroppedImageData = yoloTrackingItem.CroppedImageData;
return item;
}
}
}

Просмотреть файл

@ -0,0 +1,116 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using DNNDetector.Model;
using DNNDetector.Config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using OpenCvSharp;
using Utils.Config;
using Wrapper.Yolo;
using Wrapper.Yolo.Model;
namespace DarknetDetector
{
public class LineTriggeredDNNDarknet
{
static string YOLOCONFIG = "YoloV3TinyCoco"; // "cheap" yolo config folder name
FrameDNNDarknet frameDNNYolo;
FrameBuffer frameBufferLtDNNYolo;
public LineTriggeredDNNDarknet(double rFactor)
{
frameBufferLtDNNYolo = new FrameBuffer(DNNConfig.FRAME_SEARCH_RANGE);
frameDNNYolo = new FrameDNNDarknet(YOLOCONFIG, DNNMode.LT, rFactor);
Utils.Utils.cleanFolder(@OutputFolder.OutputFolderBGSLine);
Utils.Utils.cleanFolder(@OutputFolder.OutputFolderLtDNN);
}
public LineTriggeredDNNDarknet(List<Tuple<string, int[]>> lines)
{
frameBufferLtDNNYolo = new FrameBuffer(DNNConfig.FRAME_SEARCH_RANGE);
frameDNNYolo = new FrameDNNDarknet(YOLOCONFIG, DNNMode.LT, lines);
Utils.Utils.cleanFolder(@OutputFolder.OutputFolderBGSLine);
Utils.Utils.cleanFolder(@OutputFolder.OutputFolderLtDNN);
}
public List<Item> Run(Mat frame, int frameIndex, Dictionary<string, bool> occupancy, List<Tuple<string, int[]>> lines, Dictionary<string, int> category)
{
// buffer frame
frameBufferLtDNNYolo.Buffer(frame);
foreach (string lane in occupancy.Keys)
{
if (occupancy[lane]) //object detected by BGS
{
if (frameIndex >= DNNConfig.FRAME_SEARCH_RANGE)
{
// call yolo for crosscheck
int lineID = Array.IndexOf(occupancy.Keys.ToArray(), lane);
int subLineID = lines[lineID].Item2.Length;
frameDNNYolo.SetTrackingPoint(new System.Drawing.Point((int)((lines[lineID].Item2[subLineID - 4] + lines[lineID].Item2[subLineID - 2]) / 2),
(int)((lines[lineID].Item2[subLineID - 3] + lines[lineID].Item2[subLineID - 1]) / 2))); //only needs to check the last line in each row
Mat[] frameBufferArray = frameBufferLtDNNYolo.ToArray();
int frameIndexYolo = frameIndex - 1;
DateTime start = DateTime.Now;
List<YoloTrackingItem> analyzedTrackingItems = null;
while (frameIndex - frameIndexYolo < DNNConfig.FRAME_SEARCH_RANGE)
{
Console.WriteLine("** Calling Cheap on " + (DNNConfig.FRAME_SEARCH_RANGE - (frameIndex - frameIndexYolo)));
Mat frameYolo = frameBufferArray[DNNConfig.FRAME_SEARCH_RANGE - (frameIndex - frameIndexYolo)];
byte[] imgByte = Utils.Utils.ImageToByteBmp(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(frameYolo));
analyzedTrackingItems = frameDNNYolo.Detect(imgByte, category, lineID, System.Drawing.Brushes.Pink, DNNConfig.MIN_SCORE_FOR_LINEBBOX_OVERLAP_LARGE, frameIndexYolo);
// object detected by cheap YOLO
if (analyzedTrackingItems != null)
{
List<Item> ltDNNItem = new List<Item>();
foreach (YoloTrackingItem yoloTrackingItem in analyzedTrackingItems)
{
Item item = Item(yoloTrackingItem);
item.RawImageData = imgByte;
item.TriggerLine = lane;
item.TriggerLineID = lineID;
item.Model = "Cheap";
ltDNNItem.Add(item);
// output cheap YOLO results
string blobName_Cheap = $@"frame-{frameIndex}-Cheap-{yoloTrackingItem.Confidence}.jpg";
string fileName_Cheap = @OutputFolder.OutputFolderLtDNN + blobName_Cheap;
File.WriteAllBytes(fileName_Cheap, yoloTrackingItem.TaggedImageData);
File.WriteAllBytes(@OutputFolder.OutputFolderAll + blobName_Cheap, yoloTrackingItem.TaggedImageData);
}
return ltDNNItem;
}
frameIndexYolo--;
}
}
}
}
return null;
}
Item Item(YoloTrackingItem yoloTrackingItem)
{
Item item = new Item(yoloTrackingItem.X, yoloTrackingItem.Y, yoloTrackingItem.Width, yoloTrackingItem.Height,
yoloTrackingItem.ObjId, yoloTrackingItem.Type, yoloTrackingItem.Confidence, 0, "");
item.TrackId = yoloTrackingItem.TrackId;
item.Index = yoloTrackingItem.Index;
item.TaggedImageData = yoloTrackingItem.TaggedImageData;
item.CroppedImageData = yoloTrackingItem.CroppedImageData;
return item;
}
}
}

Просмотреть файл

@ -0,0 +1,84 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using OpenCvSharp;
namespace Decoder
{
public class Decoder
{
VideoCapture capture = null;
string inputURL;
bool toLoop;
Mat resizedFrame;
int objTotal, objDirA, objDirB;
public Decoder(string input, bool loop)
{
capture = new VideoCapture(input);
inputURL = input;
toLoop = loop;
}
public Mat getNextFrame()
{
Mat sourceMat = new Mat();
try
{
capture.Read(sourceMat);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
Console.WriteLine("********RESET*****");
capture = new VideoCapture(inputURL);
return null;
}
if (sourceMat == null)
return sourceMat;
if (toLoop)
{
if (sourceMat.Height == 0 && sourceMat.Width == 0)
{
capture = new VideoCapture(inputURL);
capture.Read(sourceMat);
}
}
return sourceMat;
}
public int getTotalFrameNum()
{
int length;
length = (int)Math.Floor(capture.Get(CaptureProperty.FrameCount));
return length;
}
public double getVideoFPS()
{
double framerate;
framerate = capture.Get(CaptureProperty.Fps);
return framerate;
}
public void updateObjNum(int[] dirCount)
{
objTotal = dirCount[0] + dirCount[1] + dirCount[2];
objDirA = dirCount[0];
objDirB = dirCount[1];
}
}
}

Просмотреть файл

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<ApplicationIcon />
<StartupObject />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenCvSharp4" Version="4.0.0.20190108" />
<PackageReference Include="OpenCvSharp4.runtime.ubuntu.18.04-x64" Version="4.0.0.20190108" />
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.0.0.20190108" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,75 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using System.Text;
using OpenCvSharp;
namespace FramePreProcessor
{
public class FrameDisplay
{
static Dictionary<string, string> displayKVpairs = new Dictionary<string, string>();
static Dictionary<string, string> prev_displayKVpairs = new Dictionary<string, string>();
public static void display(Mat resizedFrame)
{
Mat frameToDisplay = resizedFrame.Clone();
if (displayKVpairs.Count > 0)
{
double scale = 0.75;
//Header box configs
int boxHeight = (int)(80 * scale);
int boxWidth = frameToDisplay.Width;
int boxpadding = (int)(15 * scale);
//Text configs
int leftTextPadding = (int)(50 * scale);
int textPadding = (int)(10 * scale);
int textHeight = (int)(22 * scale);
string row1Text = "Total:";
string row2Text = "Network:";
int row1Textbox = (int)(20 * row1Text.Length * scale);
int row2Textbox = (int)(20 * row2Text.Length * scale);
Cv2.Rectangle(frameToDisplay, new Rect(0, boxpadding, boxWidth, boxHeight), new Scalar(255, 255, 240), Cv2.FILLED);
//Draw row 1: total count
int row1Height = textHeight + textPadding + boxpadding;
string result = "";
foreach (string dir in displayKVpairs.Keys)
{
int displayTotal = Int32.Parse(displayKVpairs[dir]);
result += dir + " " + displayTotal + " ";
}
Cv2.PutText(frameToDisplay, result, new Point(leftTextPadding + row1Textbox, row1Height), HersheyFonts.HersheyPlain, scale, Scalar.Black);
}
Cv2.ImShow("Raw Frame", frameToDisplay);
Cv2.WaitKey(1);
}
public static void updateKVPairs(Dictionary<string, string> kvpairs)
{
foreach(string s in kvpairs.Keys)
{
if (!displayKVpairs.ContainsKey(s))
displayKVpairs.Add(s, kvpairs[s]);
else
{
int currentVal = Int32.Parse(displayKVpairs[s]);
currentVal += Int32.Parse(kvpairs[s]);
displayKVpairs[s] = currentVal.ToString();
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<ApplicationIcon />
<StartupObject />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenCvSharp4" Version="4.0.0.20190108" />
<PackageReference Include="OpenCvSharp4.runtime.ubuntu.18.04-x64" Version="4.0.0.20190108" />
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.0.0.20190108" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,33 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using OpenCvSharp;
namespace FramePreProcessor
{
public class PreProcessor
{
public static Mat returnFrame(Mat sourceMat, int frameIndex, int SAMPLING_FACTOR, double RESOLUTION_FACTOR, bool display)
{
Mat resizedFrame = null;
if (frameIndex % SAMPLING_FACTOR != 0) return resizedFrame;
try
{
resizedFrame = sourceMat.Resize(new OpenCvSharp.Size((int)(sourceMat.Size().Width * RESOLUTION_FACTOR), (int)(sourceMat.Size().Height * RESOLUTION_FACTOR)));
if (display)
FrameDisplay.display(resizedFrame);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
Console.WriteLine("********RESET RESIZE*****");
return null;
}
return resizedFrame;
}
}
}

Просмотреть файл

@ -0,0 +1,154 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using System.Drawing;
using BGSObjectDetector;
namespace LineDetector
{
public class DetectionLine
{
public static int MIN_BOX_SIZE = 1000;//smaller boxes than this will go.
public static double DEFAULT_OCCUPANCY_THRESHOLD = 0.9; // default threhsold
public int x1, y1, x2, y2;
public double increment;
public double overlapFractionThreshold = DEFAULT_OCCUPANCY_THRESHOLD;
public DetectionLine(int a, int b, int c, int d)
{
x1 = a; y1 = b;
x2 = c; y2 = d;
double length = Math.Sqrt(Math.Pow((double)(y2 - y1), 2) + Math.Pow((double)(x2 - x1), 2));
increment = 1 / (2 * length);
}
public DetectionLine(int a, int b, int c, int d, double l_threshold)
{
x1 = a; y1 = b;
x2 = c; y2 = d;
double length = Math.Sqrt(Math.Pow((double)(y2 - y1), 2) + Math.Pow((double)(x2 - x1), 2));
increment = 1 / (2 * length);
overlapFractionThreshold = l_threshold;
}
public double getFractionContainedInBox(Box b, Bitmap mask)
{
double eta = 0;
double currentX = x1 + eta * (x2 - x1);
double currentY = y1 + eta * (y2 - y1);
double lastX = -1;
double lastY = -1;
int totalPixelCount = 0;
int overlapCount = 0;
do
{
if ((lastX == currentX) && (lastY == currentY)) continue;
totalPixelCount++;
bool isInside = b.IsPointInterior((int)currentX, (int)currentY);
if (mask.GetPixel((int)currentX, (int)currentY).ToString() == "Color [A=255, R=255, G=255, B=255]")
{
overlapCount++;
}
lastX = currentX; lastY = currentY;
eta += increment;
currentX = x1 + eta * (x2 - x1);
currentY = y1 + eta * (y2 - y1);
} while (eta <= 1);
double fraction = (double)overlapCount / (double)totalPixelCount;
return fraction;
}
public double getFractionInForeground(Bitmap mask)
{
double eta = 0;
double currentX = x1 + eta * (x2 - x1);
double currentY = y1 + eta * (y2 - y1);
double lastX = -1;
double lastY = -1;
int totalPixelCount = 0;
int overlapCount = 0;
do
{
if ((lastX == currentX) && (lastY == currentY)) continue;
totalPixelCount++;
if (mask.GetPixel((int)currentX, (int)currentY).ToString() == "Color [A=255, R=255, G=255, B=255]")
{
overlapCount++;
}
lastX = currentX; lastY = currentY;
eta += increment;
currentX = x1 + eta * (x2 - x1);
currentY = y1 + eta * (y2 - y1);
} while (eta <= 1);
double fraction = (double)overlapCount / (double)totalPixelCount;
return fraction;
}
public (double frac, Box b) getMaximumFractionContainedInAnyBox(List<Box> boxes, Bitmap mask)
{
double maxOverlapFraction = 0;
Box maxB = null;
for (int boxNo = 0; boxNo < boxes.Count; boxNo++)
{
Box b = boxes[boxNo];
if (b.Area < MIN_BOX_SIZE) continue;
double overlapFraction = getFractionContainedInBox(b, mask);
if (overlapFraction > maxOverlapFraction)
{
maxOverlapFraction = overlapFraction;
maxB = b;
}
}
return (maxOverlapFraction, maxB);
}
public (bool occupied, Box box) isOccupied(List<Box> boxes, Bitmap mask)
{
(double frac, Box b) = getMaximumFractionContainedInAnyBox(boxes, mask);
if (frac >= overlapFractionThreshold)
{
return (true, b);
}
else
{
return (false, null);
}
}
public bool isOccupied(Bitmap mask)
{
double frac = getFractionInForeground(mask);
if (frac >= overlapFractionThreshold)
{
return true;
}
else
{
return false;
}
}
public override string ToString()
{
return x1 + "\t" + y1 + "\t" + x2 + "\t" + y2 + "\t" + overlapFractionThreshold;
}
}
}

Просмотреть файл

@ -0,0 +1,96 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using OpenCvSharp;
using Utils.Config;
using BGSObjectDetector;
namespace LineDetector
{
public class Detector
{
bool DISPLAY_BGS;
public int START_DELAY = 120; //this is an initial delay we put in for the background subtractor to kick in, N_FRAMES_TO_LEARN in MOG2.cs
public MultiLaneDetector multiLaneDetector;
Dictionary<string, bool> occupancy = new Dictionary<string, bool>();
Dictionary<string, bool> occupancy_prev = new Dictionary<string, bool>();
public Detector(int sFactor, double rFactor, string linesFile, bool displayBGS)
{
Dictionary<string, ILineBasedDetector> lineBasedDetectors = LineSets.readLineSet_LineDetector_FromTxtFile(linesFile, sFactor, rFactor);
multiLaneDetector = (lineBasedDetectors != null) ? new MultiLaneDetector(lineBasedDetectors) : null;
this.DISPLAY_BGS = displayBGS;
Console.WriteLine(linesFile);
}
public Dictionary<string, bool> updateLineOccupancy(Mat frame, int frameIndex, Mat fgmask, List<Box> boxes)
{
//frameIndex++;
//if (frameIndex > START_DELAY && frameIndex % SUB_SAMPLING_FACTOR != 0) return frameIndex;
if (frameIndex > START_DELAY)
{
Bitmap fgmaskBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(fgmask);
multiLaneDetector.notifyFrameArrival(frameIndex, boxes, fgmaskBit);
// bgs visualization with lines
if (DISPLAY_BGS)
{
List<Tuple<string, int[]>> lines = this.multiLaneDetector.getAllLines();
for (int i = 0; i < lines.Count; i++)
{
System.Drawing.Point p1 = new System.Drawing.Point(lines[i].Item2[0], lines[i].Item2[1]);
System.Drawing.Point p2 = new System.Drawing.Point(lines[i].Item2[2], lines[i].Item2[3]);
Cv2.Line(fgmask, p1.X, p1.Y, p2.X, p2.Y, new OpenCvSharp.Scalar(255, 0, 255, 255), 5);
}
Cv2.ImShow("BGS Output", fgmask);
Cv2.WaitKey(1);
}
}
occupancy = multiLaneDetector.getOccupancy();
foreach (string lane in occupancy.Keys)
{
if (frameIndex > 1)
{
if (occupancyChanged(lane))
{
string blobName_BGS = $@"frame-{frameIndex}-BGS-{lane}-{occupancy[lane]}.jpg";
string fileName_BGS = @OutputFolder.OutputFolderBGSLine + blobName_BGS;
frame.SaveImage(fileName_BGS);
frame.SaveImage(@OutputFolder.OutputFolderAll + blobName_BGS);
}
}
updateCount(lane, occupancy);
}
return occupancy;
}
bool occupancyChanged(string lane)
{
bool diff = false;
if (occupancy_prev.Count != 0)
{
diff = occupancy[lane] != occupancy_prev[lane];
}
return diff;
}
void updateCount(string lane, Dictionary<string, bool> counts)
{
occupancy_prev[lane] = counts[lane];
}
}
}

Просмотреть файл

@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using System.Drawing;
using BGSObjectDetector;
namespace LineDetector
{
public interface ILineBasedDetector
{
void notifyFrameArrival(int frameNo, List<Box> boxes, Bitmap mask);
void notifyFrameArrival(int frameNo, Bitmap mask);
bool getOccupancy();
Box getBbox();
int[] getLineCoor();
DetectionLine getDetectionLine();
}
}

Просмотреть файл

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BGSObjectDetector\BGSObjectDetector.csproj" />
<ProjectReference Include="..\Utils\Utils.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,49 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using System.IO;
namespace LineDetector
{
class LineSets
{
public static Dictionary<string, ILineBasedDetector> readLineSet_LineDetector_FromTxtFile(string fileName, int sFactor, double imageScaling)
{
Dictionary<string, ILineBasedDetector> ret = new Dictionary<string, ILineBasedDetector>();
try
{
StreamReader r = new StreamReader(fileName);
do
{
string line = r.ReadLine();
if (line == null)
{
break;
}
string[] fields = line.Split('\t');
string directionName = fields[0];
//noLines has to be 1 in Line Detector
int x1 = (int)(Convert.ToInt32(fields[2 + 0 * 5]) * imageScaling);
int y1 = (int)(Convert.ToInt32(fields[3 + 0 * 5]) * imageScaling);
int x2 = (int)(Convert.ToInt32(fields[4 + 0 * 5]) * imageScaling);
int y2 = (int)(Convert.ToInt32(fields[5 + 0 * 5]) * imageScaling);
double threshold = Convert.ToDouble(fields[6 + 0 * 5]);
SingleLineCrossingDetector lineDetector = new SingleLineCrossingDetector(x1, y1, x2, y2, threshold, sFactor);
ret.Add(directionName, lineDetector);
} while (true);
r.Close();
}
catch (IOException e)
{
Console.WriteLine(e.ToString());
return null;
}
return ret;
}
}
}

Просмотреть файл

@ -0,0 +1,73 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using BGSObjectDetector;
using System;
using System.Collections.Generic;
using System.Drawing;
namespace LineDetector
{
// corresponds to LineCrossingBasedMultiLaneCounter.cs
public class MultiLaneDetector
{
Dictionary<string, ILineBasedDetector> laneDetector;
public MultiLaneDetector(Dictionary<string, ILineBasedDetector> lineBasedDetector)
{
laneDetector = lineBasedDetector;
}
public void notifyFrameArrival(int frameNo, List<Box> boxes, Bitmap mask)
{
foreach (KeyValuePair<string, ILineBasedDetector> entry in laneDetector)
{
entry.Value.notifyFrameArrival(frameNo, boxes, mask);
}
}
public void notifyFrameArrival(int frameNo, Bitmap mask)
{
foreach (KeyValuePair<string, ILineBasedDetector> entry in laneDetector)
{
entry.Value.notifyFrameArrival(frameNo, mask);
}
}
public Dictionary<string, bool> getOccupancy()
{
Dictionary<string, bool> occupancy = new Dictionary<string, bool>();
foreach (KeyValuePair<string, ILineBasedDetector> entry in laneDetector)
{
occupancy.Add(entry.Key, entry.Value.getOccupancy());
}
return occupancy;
}
public float[] getBboxCenter(string laneID)
{
foreach (KeyValuePair<string, ILineBasedDetector> entry in laneDetector)
{
if (entry.Key == laneID)
{
return entry.Value.getBbox().Center;
}
}
return null;
}
public List<Tuple<string, int[]>> getAllLines()
{
List<Tuple<string, int[]>> lines = new List<Tuple<string, int[]>>();
foreach (KeyValuePair<string, ILineBasedDetector> lane in laneDetector)
{
int[] coor = lane.Value.getLineCoor();
Tuple<string, int[]> line = new Tuple<string, int[]>(lane.Key, coor);
lines.Add(line);
}
return lines;
}
}
}

Просмотреть файл

@ -0,0 +1,61 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using BGSObjectDetector;
using System.Collections.Generic;
using System.Drawing;
namespace LineDetector
{
class SingleLineCrossingDetector : ILineBasedDetector
{
DetectionLine line;
bool occupancy;
Box bbox;
public SingleLineCrossingDetector(int a, int b, int c, int d)
{
line = new DetectionLine(a, b, c, d);
}
public SingleLineCrossingDetector(int a, int b, int c, int d, double threshold, int sFactor)
{
line = new DetectionLine(a, b, c, d, threshold);
}
public void notifyFrameArrival(int frameNo, List<Box> boxes, Bitmap mask)
{
(occupancy, bbox) = line.isOccupied(boxes, mask);
}
public void notifyFrameArrival(int frameNo, Bitmap mask)
{
occupancy = line.isOccupied(mask);
}
public bool getOccupancy()
{
return occupancy;
}
public DetectionLine getDetectionLine()
{
return line;
}
public Box getBbox()
{
return bbox;
}
public int[] getLineCoor()
{
int[] coor = new int[4];
coor[0] = getDetectionLine().x1;
coor[1] = getDetectionLine().y1;
coor[2] = getDetectionLine().x2;
coor[3] = getDetectionLine().y2;
return coor;
}
}
}

Просмотреть файл

@ -0,0 +1,146 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Configuration;
using System.IO;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
namespace PostProcessor
{
public class AzureBlobProcessor
{
private static CloudStorageAccount storageAccount;
private static CloudBlobClient cloudBlobClient;
public AzureBlobProcessor()
{
// Retrieve the connection string from app.config
string storageConnectionString = ConfigurationManager.AppSettings["StorageConnectionString"];
if (CloudStorageAccount.TryParse(storageConnectionString, out storageAccount))
{
try
{
// Create the CloudBlobClient that represents the Blob storage endpoint for the storage account.
cloudBlobClient = storageAccount.CreateCloudBlobClient();
}
catch (StorageException ex)
{
Console.WriteLine("Error returned from the service: {0}", ex.Message);
}
}
}
public async Task<string> CreateContainerAsync(string container = "")
{
try
{
// Create a container (appending a GUID value to it to make the name unique).
if (container == "")
{
container = Guid.NewGuid().ToString();
}
CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference(container);
await cloudBlobContainer.CreateIfNotExistsAsync();
Console.WriteLine("Created container '{0}'", cloudBlobContainer.Name);
Console.WriteLine();
// Set the permissions so the blobs are public.
BlobContainerPermissions permissions = new BlobContainerPermissions
{
PublicAccess = BlobContainerPublicAccessType.Blob
};
await cloudBlobContainer.SetPermissionsAsync(permissions);
}
catch (StorageException ex)
{
Console.WriteLine("Error returned from the service: {0}", ex.Message);
}
return container;
}
public async Task DeleteContainerAsync(string containerName)
{
try
{
CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference(containerName);
if (cloudBlobContainer != null)
{
await cloudBlobContainer.DeleteIfExistsAsync();
}
}
catch (StorageException ex)
{
Console.WriteLine("Error returned from the service: {0}", ex.Message);
}
}
public async Task<string> UploadFileAsync(string containerName, string blobName, string sourceFile)
{
string blobUri = null;
try
{
// Get a reference to the blob address, then upload the file to the blob.
CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference(containerName);
CloudBlockBlob cloudBlockBlob = cloudBlobContainer.GetBlockBlobReference(blobName);
await cloudBlockBlob.UploadFromFileAsync(sourceFile);
blobUri = cloudBlobContainer.Uri.AbsoluteUri + "/" + blobName;
}
catch (StorageException ex)
{
Console.WriteLine("Error returned from the service: {0}", ex.Message);
}
return blobUri;
}
public async Task DownloadFileAsync(string containerName, string blobName, string destinationFile)
{
try
{
// Download the blob to a local file.
CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference(containerName);
CloudBlockBlob cloudBlockBlob = cloudBlobContainer.GetBlockBlobReference(blobName);
Console.WriteLine("Downloading blob {0} to {1}", blobName, destinationFile);
Console.WriteLine();
await cloudBlockBlob.DownloadToFileAsync(destinationFile, FileMode.Create);
}
catch (StorageException ex)
{
Console.WriteLine("Error returned from the service: {0}", ex.Message);
}
}
public async Task ListBlobAsync(string containerName)
{
try
{
// List the blobs in the container.
CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference(containerName);
Console.WriteLine("Listing blobs in container {0}.", containerName);
BlobContinuationToken blobContinuationToken = null;
do
{
var results = await cloudBlobContainer.ListBlobsSegmentedAsync(null, blobContinuationToken);
// Get the value of the continuation token returned by the listing call.
blobContinuationToken = results.ContinuationToken;
foreach (IListBlobItem item in results.Results)
{
Console.WriteLine(item.Uri);
}
} while (blobContinuationToken != null); // Loop while the continuation token is not null.
Console.WriteLine();
}
catch (StorageException ex)
{
Console.WriteLine("Error returned from the service: {0}", ex.Message);
}
}
}
}

Просмотреть файл

@ -0,0 +1,203 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using PostProcessor.Model;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Runtime.Serialization.Json;
using System.Threading.Tasks;
namespace PostProcessor
{
public class DBClient
{
private static readonly string DBServer = ConfigurationManager.AppSettings["DBServer"];
private static readonly string DBCred = ConfigurationManager.AppSettings["DBCred"];
private static readonly string DBName = ConfigurationManager.AppSettings["DBName"];
private static readonly HttpClient client = new HttpClient();
public static async Task<Camera> GetDocumentCamera(string id)
{
var serializer = new DataContractJsonSerializer(typeof(Camera));
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", DBCred);
System.IO.Stream streamTask = null;
Camera jsonCamera = null;
try
{
streamTask = await client.GetStreamAsync(DBServer + "_db/" + DBName + "/_api/document/camera/" + id);
jsonCamera = serializer.ReadObject(streamTask) as Camera;
}
catch (Exception)
{
}
/* Using GetStringAsync */
//var stringTask = client.GetStringAsync(DBServer + "_db/" + DBName + "/_api/document/camera/" + id);
//var msg = await stringTask;
//var msgStream = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(msg));
//var jsonCamera = serializer.ReadObject(msgStream) as Camera;
return jsonCamera;
}
public static async Task<Model.Object> GetDocumentObject(string id)
{
var serializer = new DataContractJsonSerializer(typeof(Model.Object));
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", DBCred);
System.IO.Stream streamTask = null;
Model.Object jsonObject = null;
try
{
streamTask = await client.GetStreamAsync(DBServer + "_db/" + DBName + "/_api/document/object/" + id);
jsonObject = serializer.ReadObject(streamTask) as Model.Object;
}
catch (Exception)
{
}
return jsonObject;
}
public static async Task<Detection> GetDocumentDetection(string id)
{
var serializer = new DataContractJsonSerializer(typeof(Detection));
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", DBCred);
System.IO.Stream streamTask = null;
Detection jsonDetection = null;
try
{
streamTask = await client.GetStreamAsync(DBServer + "_db/" + DBName + "/_api/document/detection/" + id);
jsonDetection = serializer.ReadObject(streamTask) as Detection;
}
catch (Exception)
{
}
return jsonDetection;
}
public static async Task<string[]> ProcessQueryRaw(string content)
{
string[] result = new string[2];
var serializer = new DataContractJsonSerializer(typeof(QueryRaw));
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", DBCred);
var buffer = System.Text.Encoding.UTF8.GetBytes(content);
var byteContent = new ByteArrayContent(buffer);
HttpResponseMessage response = null;
try
{
var stopWatch = Stopwatch.StartNew();
response = await client.PostAsync(DBServer + "_db/" + DBName + "/_api/cursor", byteContent);
result[0] = stopWatch.Elapsed.ToString();
}
catch (Exception)
{
return null;
}
//var message = new HttpRequestMessage(HttpMethod.Post, DBServer + "_db/" + DBName + "/_api/cursor");
//message.Content = new StringContent(content, System.Text.Encoding.UTF8, "application/json");
//var response = await client.SendAsync(message, HttpCompletionOption.ResponseHeadersRead);
var stream = await response.Content.ReadAsStreamAsync();
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
result[1] = reader.ReadToEnd();
stream.Position = 0;
return result;
}
public static async Task<List<Consolidation>> ProcessQuery(string content)
{
var serializer = new DataContractJsonSerializer(typeof(QueryRaw));
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", DBCred);
var buffer = System.Text.Encoding.UTF8.GetBytes(content);
var byteContent = new ByteArrayContent(buffer);
HttpResponseMessage response = null;
try
{
response = await client.PostAsync(DBServer + "_db/" + DBName + "/_api/cursor", byteContent);
}
catch (Exception)
{
return null;
}
//var message = new HttpRequestMessage(HttpMethod.Post, DBServer + "_db/" + DBName + "/_api/cursor");
//message.Content = new StringContent(content, System.Text.Encoding.UTF8, "application/json");
//var response = await client.SendAsync(message, HttpCompletionOption.ResponseHeadersRead);
var stream = await response.Content.ReadAsStreamAsync();
//System.IO.StreamReader reader = new System.IO.StreamReader(stream);
//string text = reader.ReadToEnd();
//stream.Position = 0;
var queryRaw = serializer.ReadObject(stream) as QueryRaw;
return queryRaw.QResult;
}
public static async Task<System.Net.HttpStatusCode> CreateCollection(string cltName)
{
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", DBCred);
string content = "{\"name\": \"" + cltName + "\"}";
var buffer = System.Text.Encoding.UTF8.GetBytes(content);
var byteContent = new ByteArrayContent(buffer);
HttpResponseMessage response = null;
try
{
response = await client.PostAsync(DBServer + "_db/" + DBName + "/_api/collection", byteContent);
}
catch (Exception)
{
return 0;
}
return response.StatusCode;
}
public static async Task<System.Net.HttpStatusCode> CreateDocument(string cltName, string content)
{
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", DBCred);
var buffer = System.Text.Encoding.UTF8.GetBytes(content);
var byteContent = new ByteArrayContent(buffer);
HttpResponseMessage response = null;
try
{
response = await client.PostAsync(DBServer + "_db/" + DBName + "/_api/document/" + cltName, byteContent);
}
catch (Exception)
{
return 0;
}
return response.StatusCode;
}
}
}

Просмотреть файл

@ -0,0 +1,89 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using DNNDetector.Model;
using System;
using System.IO;
using System.Collections.Generic;
using System.Runtime.Serialization.Json;
using Utils.Config;
namespace PostProcessor
{
public enum Position
{
Right,
Left,
Up,
Down,
Unknown
}
public class DataPersistence
{
//string blobUri_BGS = null;
static AzureBlobProcessor blobProcessor = new AzureBlobProcessor();
// force precise initialization
static DataPersistence() { }
public static void PersistResult(string dbCollectionName, string videoUrl, int cameraID, int frameIndex, List<Item> detectionResult, Position[] objDir, string YOLOCONFIG, string YOLOCONFIG_HEAVY,
string azureContainerName)
{
if (detectionResult != null && detectionResult.Count != 0)
{
foreach (Item it in detectionResult)
{
var fileList = Directory.GetFiles(@OutputFolder.OutputFolderAll, $"frame-{frameIndex}*");
string blobName = Path.GetFileName(fileList[fileList.Length-1]);
//string blobName = it.Model == "Cheap" ? $@"frame-{frameIndex}-Cheap-{it.Confidence}.jpg" : $@"frame-{frameIndex}-Heavy-{it.Confidence}.jpg";
string blobUri = SendDataToCloud(azureContainerName, blobName, @OutputFolder.OutputFolderAll + blobName);
string serializedResult = SerializeDetectionResult(videoUrl, cameraID, frameIndex, it, objDir, blobUri, YOLOCONFIG, YOLOCONFIG_HEAVY);
WriteDB(dbCollectionName, serializedResult);
}
}
}
public static string SendDataToCloud(string containerName, string blobName, string sourceFile)
{
return blobProcessor.UploadFileAsync(containerName, blobName, sourceFile).GetAwaiter().GetResult();
}
private static string SerializeDetectionResult(string videoUrl, int cameraID, int frameIndex, Item item, Position[] objDir, string imageUri, string YOLOCONFIG, string YOLOCONFIG_HEAVY)
{
Model.Consolidation detectionConsolidation = new Model.Consolidation();
detectionConsolidation.Key = Guid.NewGuid().ToString();
detectionConsolidation.CameraID = cameraID;
detectionConsolidation.Frame = frameIndex;
detectionConsolidation.ObjID = item.ObjId;
detectionConsolidation.ObjName = item.ObjName;
detectionConsolidation.Bbox = new int[] { item.X, item.Y, item.Height, item.Width };
detectionConsolidation.Prob = item.Confidence;
detectionConsolidation.ObjDir = objDir[0].ToString() + objDir[1].ToString();
detectionConsolidation.ImageUri = new Uri(imageUri);
detectionConsolidation.VideoInput = videoUrl;
detectionConsolidation.YoloCheap = YOLOCONFIG;
detectionConsolidation.YoloHeavy = YOLOCONFIG_HEAVY;
detectionConsolidation.Time = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffffff");
//Create a stream to serialize the object to.
MemoryStream ms = new MemoryStream();
// Serializer the User object to the stream.
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Model.Consolidation));
ser.WriteObject(ms, detectionConsolidation);
byte[] json = ms.ToArray();
ms.Close();
return System.Text.Encoding.UTF8.GetString(json, 0, json.Length);
}
private static int WriteDB(string collectionName, string content)
{
//var createCltResult = Client.CreateCollection().Result;
var createDocResult = DBClient.CreateDocument(collectionName, content).Result;
return (int)createDocResult;
}
}
}

Просмотреть файл

@ -0,0 +1,55 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System.Runtime.Serialization;
using System;
using System.Globalization;
namespace PostProcessor.Model
{
[DataContract(Name = "clctCamera")]
public class Camera
{
[DataMember(Name = "_key")]
public string Key { get; set; }
[DataMember(Name = "_id")]
public string ID { get; set; }
[DataMember(Name = "_rev")]
public string Rev { get; set; }
[DataMember(Name = "camera_id")]
public int CameraID { get; set; }
[DataMember(Name = "frame")]
public int Frame { get; set; }
[DataMember(Name = "obj_num")]
public int ObjNum { get; set; }
[DataMember(Name = "VideoInput")]
public Uri VideoInput { get; set; }
[DataMember(Name = "YOLOCONFIG_CFG")]
public Uri YoloCfg { get; set; }
[DataMember(Name = "YOLOCONFIG_NAMES")]
public Uri YoloNames { get; set; }
[DataMember(Name = "YOLOCONFIG_WEIGHTS")]
public Uri YoloWeights { get; set; }
[DataMember(Name = "time")]
private string Time { get; set; }
[IgnoreDataMember]
public DateTime RecordTime
{
get
{
return DateTime.ParseExact(Time, "yyyy-MM-ddTHH:mm:ss.fffffff", CultureInfo.InvariantCulture);
}
}
}
}

Просмотреть файл

@ -0,0 +1,78 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System.Runtime.Serialization;
using System;
using System.Globalization;
namespace PostProcessor.Model
{
[DataContract(Name = "clctConsolidation")]
public class Consolidation
{
[DataMember(Name = "_key")]
public string Key { get; set; }
[DataMember(Name = "_id")]
public string ID { get; set; }
[DataMember(Name = "_rev")]
public string Rev { get; set; }
[DataMember(Name = "camera_id")]
public int CameraID { get; set; }
[DataMember(Name = "frame")]
public int Frame { get; set; }
// @TODO: support multiple objects
[DataMember(Name = "obj_id")]
public int ObjID { get; set; }
[DataMember(Name = "obj_name")]
public string ObjName { get; set; }
[DataMember(Name = "bbox")]
public int[] Bbox { get; set; }
[DataMember(Name = "prob")]
public double Prob { get; set; }
[DataMember(Name = "obj_moving_dir")]
public string ObjDir { get; set; }
[DataMember(Name = "imageUri")]
public Uri ImageUri { get; set; }
[DataMember(Name = "time")]
public string Time { get; set; }
[DataMember(Name = "VideoInput")]
public string VideoInput { get; set; }
[DataMember(Name = "YOLOCONFIG_CHEAP")]
public string YoloCheap { get; set; }
[DataMember(Name = "YOLOCONFIG_CHEAP_CFG")]
public Uri YoloCheapCfg { get; set; }
[DataMember(Name = "YOLOCONFIG_CHEAP_NAMES")]
public Uri YoloCheapNames { get; set; }
[DataMember(Name = "YOLOCONFIG_CHEAP_WEIGHTS")]
public Uri YoloCheapWeights { get; set; }
[DataMember(Name = "YOLOCONFIG_HEAVY")]
public string YoloHeavy { get; set; }
[DataMember(Name = "YOLOCONFIG_HEAVY_CFG")]
public Uri YoloHeavyCfg { get; set; }
[DataMember(Name = "YOLOCONFIG_HEAVY_NAMES")]
public Uri YoloHeavyNames { get; set; }
[DataMember(Name = "YOLOCONFIG_HEAVY_WEIGHTS")]
public Uri YoloHeavyWeights { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,49 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System.Runtime.Serialization;
using System;
using System.Globalization;
namespace PostProcessor.Model
{
[DataContract(Name = "clctDetection")]
public class Detection
{
[DataMember(Name = "_key")]
public string Key { get; set; }
[DataMember(Name = "_id")]
public string ID { get; set; }
[DataMember(Name = "_rev")]
public string Rev { get; set; }
[DataMember(Name = "_from")]
public string From { get; set; }
[DataMember(Name = "_to")]
public string To { get; set; }
[DataMember(Name = "bbox")]
public int[] Bbox { get; set; }
[DataMember(Name = "prob")]
public double Prob { get; set; }
[DataMember(Name = "obj_moving_dir")]
public string ObjDir { get; set; }
[DataMember(Name = "time")]
private string Time { get; set; }
[IgnoreDataMember]
public DateTime RecordTime
{
get
{
return DateTime.ParseExact(Time, "yyyy-MM-ddTHH:mm:ss.fffffff", CultureInfo.InvariantCulture);
}
}
}
}

Просмотреть файл

@ -0,0 +1,58 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System.Runtime.Serialization;
using System;
using System.Globalization;
namespace PostProcessor.Model
{
[DataContract(Name = "clctObject")]
public class Object
{
[DataMember(Name = "_key")]
public string Key { get; set; }
[DataMember(Name = "_id")]
public string ID { get; set; }
[DataMember(Name = "_rev")]
public string Rev { get; set; }
[DataMember(Name = "obj_id")]
public int ObjID { get; set; }
[DataMember(Name = "obj_name")]
public string ObjName { get; set; }
[DataMember(Name = "camera_id")]
public int CameraID { get; set; }
[DataMember(Name = "track_id")]
public int TrackID { get; set; }
[DataMember(Name = "VideoInput")]
public Uri VideoInput { get; set; }
[DataMember(Name = "YOLOCONFIG_CFG")]
public Uri YoloCfg { get; set; }
[DataMember(Name = "YOLOCONFIG_NAMES")]
public Uri YoloNames { get; set; }
[DataMember(Name = "YOLOCONFIG_WEIGHTS")]
public Uri YoloWeights { get; set; }
[DataMember(Name = "time")]
private string Time { get; set; }
[IgnoreDataMember]
public DateTime RecordTime
{
get
{
return DateTime.ParseExact(Time, "yyyy-MM-ddTHH:mm:ss.fffffff", CultureInfo.InvariantCulture);
}
}
}
}

Просмотреть файл

@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System.Runtime.Serialization;
using System.Collections.Generic;
namespace PostProcessor.Model
{
[DataContract(Name = "queryResponse")]
public class QueryRaw
{
[DataMember(Name = "result")]
public List<Consolidation> QResult { get; set; }
[DataMember(Name = "hasmore")]
public bool Hasmore { get; set; }
[DataMember(Name = "cached")]
public bool Cached { get; set; }
//[DataMember(Name = "extra")]
//public string Extra { get; set; }
[DataMember(Name = "error")]
public string Error { get; set; }
[DataMember(Name = "code")]
public int Code { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,84 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System.Runtime.Serialization;
using System;
using System.Globalization;
namespace PostProcessor.Model
{
[DataContract(Name = "repo")]
public class Repository
{
/* universal names */
[DataMember(Name = "_key")]
public string Key { get; set; }
[DataMember(Name = "_id")]
public string ID { get; set; }
[DataMember(Name = "_rev")]
public string Rev { get; set; }
[DataMember(Name = "time")]
private string Time { get; set; }
[IgnoreDataMember]
public DateTime RecordTime
{
get
{
return DateTime.ParseExact(Time, "yyyy-MM-ddTHH:mm:ss.fffffff", CultureInfo.InvariantCulture);
}
}
/* camera/object collection names */
[DataMember(Name = "camera_id")]
public int CameraID { get; set; }
[DataMember(Name = "VideoInput")]
public Uri VideoInput { get; set; }
[DataMember(Name = "YOLOCONFIG_CFG")]
public Uri YoloCfg { get; set; }
[DataMember(Name = "YOLOCONFIG_NAMES")]
public Uri YoloNames { get; set; }
[DataMember(Name = "YOLOCONFIG_WEIGHTS")]
public Uri YoloWeights { get; set; }
/* camera collection names */
[DataMember(Name = "frame")]
public int Frame { get; set; }
[DataMember(Name = "obj_num")]
public int ObjNum { get; set; }
/* object collection names */
[DataMember(Name = "obj_id")]
public int ObjID { get; set; }
[DataMember(Name = "obj_name")]
public string ObjName { get; set; }
[DataMember(Name = "track_id")]
public int TrackID { get; set; }
/* detection collection names */
[DataMember(Name = "_from")]
public string From { get; set; }
[DataMember(Name = "_to")]
public string To { get; set; }
[DataMember(Name = "bbox")]
public int[] Bbox { get; set; }
[DataMember(Name = "prob")]
public double Prob { get; set; }
[DataMember(Name = "obj_moving_dir")]
public string ObjDir { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="Model\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DarknetDetector\DarknetDetector.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using System.Text;
using OpenCvSharp;
namespace TFDetector
{
class FrameBuffer
{
Queue<Mat> frameBuffer;
int bSize;
public FrameBuffer(int size)
{
bSize = size;
frameBuffer = new Queue<Mat>(bSize);
}
public void Buffer(Mat frame)
{
frameBuffer.Enqueue(frame);
if (frameBuffer.Count > bSize)
frameBuffer.Dequeue();
}
public Mat[] ToArray()
{
return frameBuffer.ToArray();
}
}
}

Просмотреть файл

@ -0,0 +1,157 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using DNNDetector.Config;
using DNNDetector.Model;
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using Utils.Config;
using Wrapper.TF;
using Wrapper.TF.Common;
namespace TFDetector
{
public class FrameDNNTF
{
private static int _imageWidth, _imageHeight, _index;
private static List<Tuple<string, int[]>> _lines;
private static Dictionary<string, int> _category;
TFWrapper tfWrapper = new TFWrapper();
byte[] imageByteArray;
Brush bboxColor = Brushes.Green;
public FrameDNNTF(List<Tuple<string, int[]>> lines)
{
_lines = lines;
}
public List<Item> Run(Mat frameTF, int frameIndex, Dictionary<string, int> category, Brush bboxColor, double min_score_for_linebbox_overlap)
{
_imageWidth = frameTF.Width;
_imageHeight = frameTF.Height;
_category = category;
imageByteArray = Utils.Utils.ImageToByteJpeg(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(frameTF));
float[,,] boxes;
float[,] scores, classes;
(boxes, scores, classes) = tfWrapper.Run(imageByteArray);
List<Item> preValidItems = ValidateItems(boxes, scores, classes, DNNConfig.MIN_SCORE_FOR_TFOBJECT_OUTPUT);
List<Item> validObjects = new List<Item>();
//run overlap ratio-based validation
if (_lines != null)
{
for (int lineID = 0; lineID < _lines.Count; lineID++)
{
var overlapItems = preValidItems.Select(o => new { Overlap = Utils.Utils.checkLineBboxOverlapRatio(_lines[lineID].Item2, o.X, o.Y, o.Width, o.Height), Bbox_x = o.X + o.Width, Bbox_y = o.Y + o.Height, Distance = this.Distance(_lines[lineID].Item2, o.Center()), Item = o })
.Where(o => o.Bbox_x <= _imageWidth && o.Bbox_y <= _imageHeight && o.Overlap >= min_score_for_linebbox_overlap).OrderBy(o => o.Distance);
foreach (var item in overlapItems)
{
item.Item.TaggedImageData = Utils.Utils.DrawImage(imageByteArray, item.Item.X, item.Item.Y, item.Item.Width, item.Item.Height, bboxColor);
item.Item.CroppedImageData = Utils.Utils.CropImage(imageByteArray, item.Item.X, item.Item.Y, item.Item.Width, item.Item.Height);
item.Item.Index = _index;
validObjects.Add(item.Item);
_index++;
}
}
}
// output tf results
foreach (Item it in validObjects)
{
string blobName_TF = $@"frame-{frameIndex}-TF-{it.Confidence}.jpg";
string fileName_TF = @OutputFolder.OutputFolderFrameDNNTF + blobName_TF;
File.WriteAllBytes(fileName_TF, it.TaggedImageData);
File.WriteAllBytes(@OutputFolder.OutputFolderAll + blobName_TF, it.TaggedImageData);
using (Image image = Image.FromStream(new MemoryStream(it.TaggedImageData)))
{
image.Save(@OutputFolder.OutputFolderFrameDNNTF + $"frame-{frameIndex}-TF-{it.Confidence}.jpg", ImageFormat.Jpeg);
image.Save(@OutputFolder.OutputFolderAll + $"frame-{frameIndex}-TF-{it.Confidence}.jpg", ImageFormat.Jpeg);
}
}
return (validObjects.Count == 0 ? null : validObjects);
}
List<Item> ValidateItems(float[,,] boxes, float[,] scores, float[,] classes, double minScore)
{
List<Item> frameDNNItem = new List<Item>();
var x = boxes.GetLength(0);
var y = boxes.GetLength(1);
var z = boxes.GetLength(2);
float ymin = 0, xmin = 0, ymax = 0, xmax = 0;
for (int i = 0; i < x; i++)
{
for (int j = 0; j < y; j++)
{
if (scores[i, j] < minScore) continue;
int value = Convert.ToInt32(classes[i, j]);
CatalogItem catalogItem = TFWrapper._catalog.FirstOrDefault(item => item.Id == value);
if (!_category.ContainsKey(catalogItem.DisplayName)) continue;
for (int k = 0; k < z; k++)
{
var box = boxes[i, j, k];
switch (k)
{
case 0:
ymin = box;
break;
case 1:
xmin = box;
break;
case 2:
ymax = box;
break;
case 3:
xmax = box;
break;
}
}
int bbox_x = (int)(xmin * _imageWidth), bbox_y = (int)(ymin * _imageHeight),
bbox_w = (int)((xmax - xmin) * _imageWidth), bbox_h = (int)((ymax - ymin) * _imageHeight);
//check line overlap
for (int lineID = 0; lineID < _lines.Count; lineID++)
{
float ratio = Utils.Utils.checkLineBboxOverlapRatio(_lines[lineID].Item2, bbox_x, bbox_y, bbox_w, bbox_h);
if (ratio >= DNNConfig.MIN_SCORE_FOR_LINEBBOX_OVERLAP_SMALL)
{
Item it = new Item(bbox_x, bbox_y, bbox_w, bbox_h, catalogItem.Id, catalogItem.DisplayName, scores[i, j], lineID, _lines[lineID].Item1);
it.TaggedImageData = Utils.Utils.DrawImage(imageByteArray, bbox_x, bbox_y, bbox_w, bbox_h, bboxColor);
it.CroppedImageData = Utils.Utils.CropImage(imageByteArray, bbox_x, bbox_y, bbox_w, bbox_h);
frameDNNItem.Add(it);
break;
}
}
}
}
return frameDNNItem;
}
private double Distance(int[] line, System.Drawing.Point bboxCenter)
{
System.Drawing.Point p1 = new System.Drawing.Point((int)((line[0] + line[2]) / 2), (int)((line[1] + line[3]) / 2));
return Math.Sqrt(this.Pow2(bboxCenter.X - p1.X) + Pow2(bboxCenter.Y - p1.Y));
}
private double Pow2(double x)
{
return x * x;
}
}
}

Просмотреть файл

@ -0,0 +1,86 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using DNNDetector.Config;
using DNNDetector.Model;
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Utils.Config;
namespace TFDetector
{
public class LineTriggeredDNNTF
{
//static string TFCONFIG = "";
FrameDNNTF frameDNNTF;
FrameBuffer frameBufferLtDNNTF;
public LineTriggeredDNNTF(List<Tuple<string, int[]>> lines)
{
frameBufferLtDNNTF = new FrameBuffer(DNNConfig.FRAME_SEARCH_RANGE);
frameDNNTF = new FrameDNNTF(lines);
Utils.Utils.cleanFolder(@OutputFolder.OutputFolderBGSLine);
Utils.Utils.cleanFolder(@OutputFolder.OutputFolderLtDNN);
}
public List<Item> Run(Mat frame, int frameIndex, Dictionary<string, bool> occupancy, List<Tuple<string, int[]>> lines, Dictionary<string, int> category)
{
// buffer frame
frameBufferLtDNNTF.Buffer(frame);
foreach (string lane in occupancy.Keys)
{
if (occupancy[lane]) //object detected by BGS
{
if (frameIndex >= DNNConfig.FRAME_SEARCH_RANGE)
{
// call tf cheap model for crosscheck
int lineID = Array.IndexOf(occupancy.Keys.ToArray(), lane);
int subLineID = lines[lineID].Item2.Length;
Mat[] frameBufferArray = frameBufferLtDNNTF.ToArray();
int frameIndexTF = frameIndex - 1;
DateTime start = DateTime.Now;
List<Item> analyzedTrackingItems = null;
while (frameIndex - frameIndexTF < DNNConfig.FRAME_SEARCH_RANGE)
{
Console.WriteLine("** Calling Cheap on " + (DNNConfig.FRAME_SEARCH_RANGE - (frameIndex - frameIndexTF)));
Mat frameTF = frameBufferArray[DNNConfig.FRAME_SEARCH_RANGE - (frameIndex - frameIndexTF)];
analyzedTrackingItems = frameDNNTF.Run(frameTF, frameIndexTF, category, System.Drawing.Brushes.Pink, DNNConfig.MIN_SCORE_FOR_LINEBBOX_OVERLAP_LARGE);
// object detected by cheap model
if (analyzedTrackingItems != null)
{
List<Item> ltDNNItem = new List<Item>();
foreach (Item item in analyzedTrackingItems)
{
item.RawImageData = Utils.Utils.ImageToByteBmp(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(frameTF));
item.TriggerLine = lane;
item.TriggerLineID = lineID;
item.Model = "Cheap";
ltDNNItem.Add(item);
// output cheap TF results
string blobName_Cheap = $@"frame-{frameIndex}-Cheap-{item.Confidence}.jpg";
string fileName_Cheap = @OutputFolder.OutputFolderLtDNN + blobName_Cheap;
File.WriteAllBytes(fileName_Cheap, item.TaggedImageData);
File.WriteAllBytes(@OutputFolder.OutputFolderAll + blobName_Cheap, item.TaggedImageData);
}
return ltDNNItem;
}
frameIndexTF--;
}
}
}
}
return null;
}
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше